summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2018-04-19 16:56:36 +0200
committerToon Claes <toon@gitlab.com>2018-05-07 09:42:09 +0200
commitb07c4e3dc454fb90c320b3912ef84da06cd56ddf (patch)
treecdb78d54c636a3189298b9a4fe79e0488af37ab7 /app/workers
parent6dca7b5b0d8920f2c7aaedefdb8ee1a056d7a1c2 (diff)
downloadgitlab-ce-b07c4e3dc454fb90c320b3912ef84da06cd56ddf.tar.gz
Remove `Rails.env.test?` from production code
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/repository_check/batch_worker.rb13
1 files changed, 1 insertions, 12 deletions
diff --git a/app/workers/repository_check/batch_worker.rb b/app/workers/repository_check/batch_worker.rb
index 76688cf51c1..ac9df0ce05f 100644
--- a/app/workers/repository_check/batch_worker.rb
+++ b/app/workers/repository_check/batch_worker.rb
@@ -15,7 +15,7 @@ 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 current_settings.repository_checks_enabled
+ break unless Gitlab::CurrentSettings.repository_checks_enabled
next unless try_obtain_lease(project_id)
@@ -47,16 +47,5 @@ module RepositoryCheck
timeout: 24.hours
).try_obtain
end
-
- def current_settings
- # No caching of the settings! If we cache them and an admin disables
- # this feature, an active RepositoryCheckWorker would keep going for up
- # to 1 hour after the feature was disabled.
- if Rails.env.test?
- Gitlab::CurrentSettings.fake_application_settings
- else
- ApplicationSetting.current
- end
- end
end
end