summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-19 17:43:50 +0000
committerClement Ho <ClemMakesApps@gmail.com>2017-06-19 15:45:51 -0500
commit74b3b54929ed1a6453c342e66da4b0f8db9f72eb (patch)
treee26cb5aa28058d4b01ce3691ce99428ff6f9b4b3
parent80b6a6e1f23674800c081f717186b5cb8e72c4cf (diff)
downloadgitlab-ce-74b3b54929ed1a6453c342e66da4b0f8db9f72eb.tar.gz
Merge branch 'reduce-sidekiq-wait-timings' into 'master'
Reduce wait timings for Sidekiq jobs See merge request !12270
-rw-r--r--app/services/users/refresh_authorized_projects_service.rb2
-rw-r--r--changelogs/unreleased/reduce-sidekiq-wait-timings.yml4
-rw-r--r--lib/gitlab/job_waiter.rb2
3 files changed, 6 insertions, 2 deletions
diff --git a/app/services/users/refresh_authorized_projects_service.rb b/app/services/users/refresh_authorized_projects_service.rb
index 3e07b811027..f028f5eb0d4 100644
--- a/app/services/users/refresh_authorized_projects_service.rb
+++ b/app/services/users/refresh_authorized_projects_service.rb
@@ -34,7 +34,7 @@ module Users
# Keep trying until we obtain the lease. If we don't do so we may end up
# not updating the list of authorized projects properly. To prevent
# hammering Redis too much we'll wait for a bit between retries.
- sleep(1)
+ sleep(0.1)
end
begin
diff --git a/changelogs/unreleased/reduce-sidekiq-wait-timings.yml b/changelogs/unreleased/reduce-sidekiq-wait-timings.yml
new file mode 100644
index 00000000000..4d23accc82e
--- /dev/null
+++ b/changelogs/unreleased/reduce-sidekiq-wait-timings.yml
@@ -0,0 +1,4 @@
+---
+title: Reduce time spent waiting for certain Sidekiq jobs to complete
+merge_request:
+author:
diff --git a/lib/gitlab/job_waiter.rb b/lib/gitlab/job_waiter.rb
index 8db91d25a4b..208f0e1bbea 100644
--- a/lib/gitlab/job_waiter.rb
+++ b/lib/gitlab/job_waiter.rb
@@ -14,7 +14,7 @@ module Gitlab
# timeout - The maximum amount of seconds to block the caller for. This
# ensures we don't indefinitely block a caller in case a job takes
# long to process, or is never processed.
- def wait(timeout = 60)
+ def wait(timeout = 10)
start = Time.current
while (Time.current - start) <= timeout