Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2018-04-24 22:13:34 +0300
committerToon Claes <toon@gitlab.com>2018-05-07 10:42:09 +0300
commitce9355c85f92107e96990d1c1611cf4f864fccc8 (patch)
tree8f7b7f0abac49c5f549aac8871cdfcec1349c11d /app/workers/repository_check/batch_worker.rb
parent5141984747eea59a77cfdf330781e2eeabcd582e (diff)
Due to caching, there is no need to check the settings every loop
Diffstat (limited to 'app/workers/repository_check/batch_worker.rb')
-rw-r--r--app/workers/repository_check/batch_worker.rb3
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)