diff options
-rw-r--r-- | app/workers/stuck_ci_builds_worker.rb | 7 | ||||
-rw-r--r-- | spec/workers/stuck_ci_builds_worker_spec.rb | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/app/workers/stuck_ci_builds_worker.rb b/app/workers/stuck_ci_builds_worker.rb index e9bd3f180b7..c89c5832afd 100644 --- a/app/workers/stuck_ci_builds_worker.rb +++ b/app/workers/stuck_ci_builds_worker.rb @@ -2,7 +2,7 @@ class StuckCiBuildsWorker include Sidekiq::Worker include CronjobQueue - EXCLUSIVE_LEASE_KEY = 'stuck_ci_builds_worker_lease' + EXCLUSIVE_LEASE_KEY = 'stuck_ci_builds_worker_lease'.freeze BUILD_RUNNING_OUTDATED_TIMEOUT = 1.hour BUILD_PENDING_OUTDATED_TIMEOUT = 1.day @@ -23,10 +23,7 @@ class StuckCiBuildsWorker private def try_obtain_lease - @uuid = Gitlab::ExclusiveLease.new( - EXCLUSIVE_LEASE_KEY, - timeout: 30.minutes - ).try_obtain + @uuid = Gitlab::ExclusiveLease.new(EXCLUSIVE_LEASE_KEY, timeout: 30.minutes).try_obtain end def remove_lease diff --git a/spec/workers/stuck_ci_builds_worker_spec.rb b/spec/workers/stuck_ci_builds_worker_spec.rb index 5b87718a795..82bdc2b14f3 100644 --- a/spec/workers/stuck_ci_builds_worker_spec.rb +++ b/spec/workers/stuck_ci_builds_worker_spec.rb @@ -126,4 +126,4 @@ describe StuckCiBuildsWorker do worker.perform end end -end
\ No newline at end of file +end |