diff options
author | Toon Claes <toon@gitlab.com> | 2018-04-24 22:13:34 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-05-07 10:42:09 +0300 |
commit | ce9355c85f92107e96990d1c1611cf4f864fccc8 (patch) | |
tree | 8f7b7f0abac49c5f549aac8871cdfcec1349c11d /app | |
parent | 5141984747eea59a77cfdf330781e2eeabcd582e (diff) |
Due to caching, there is no need to check the settings every loop
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/repository_check/batch_worker.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/workers/repository_check/batch_worker.rb b/app/workers/repository_check/batch_worker.rb index ac9df0ce05f..544c1fe545b 100644 --- a/app/workers/repository_check/batch_worker.rb +++ b/app/workers/repository_check/batch_worker.rb @@ -6,6 +6,8 @@ module RepositoryCheck RUN_TIME = 3600 def perform + break unless Gitlab::CurrentSettings.repository_checks_enabled + start = Time.now # This loop will break after a little more than one hour ('a little @@ -15,7 +17,6 @@ module RepositoryCheck # check, only one (or two) will be checked at a time. project_ids.each do |project_id| break if Time.now - start >= RUN_TIME - break unless Gitlab::CurrentSettings.repository_checks_enabled next unless try_obtain_lease(project_id) |