summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-06-08 12:27:35 +0000
committerDouwe Maan <douwe@gitlab.com>2016-06-08 12:27:35 +0000
commita0320bed7e9486e964faed95c5bb512d482661c4 (patch)
tree98c07e469c02880161bc1bdd88cc455e6b22f14c /lib
parentc0f31845d34362b726506ecf08ceab06010dadd6 (diff)
parent59e5f4705b37014a2b3cc12959c3ac7e65328ec3 (diff)
downloadgitlab-ce-a0320bed7e9486e964faed95c5bb512d482661c4.tar.gz
Merge branch 'gh-disable-webhooks' into 'master'
Check if GitHub rate limite API was reached before update Webhooks ## What does this MR do? Checks if the job needs to sleep, and wait for the rate limit to be reseted before update each Webhook. ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? The import process can fail if the API rate limit was reached during the import process. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/17498 ## Screenshots (if relevant) Not relevant. See merge request !4509
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/importer.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb
index 442b4c389fe..5ef9d66ba68 100644
--- a/lib/gitlab/github_import/importer.rb
+++ b/lib/gitlab/github_import/importer.rb
@@ -146,6 +146,7 @@ module Gitlab
def update_webhooks(hooks, options)
hooks.each do |hook|
+ sleep rate_limit_sleep_time if rate_limit_exceed?
client.edit_hook(repo, hook.id, hook.name, hook.config, options)
end
end