Commit 44ef6806 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Fix rubocop offenses

parent 6db7c232
...@@ -2,7 +2,7 @@ class StuckCiBuildsWorker ...@@ -2,7 +2,7 @@ class StuckCiBuildsWorker
include Sidekiq::Worker include Sidekiq::Worker
include CronjobQueue 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_RUNNING_OUTDATED_TIMEOUT = 1.hour
BUILD_PENDING_OUTDATED_TIMEOUT = 1.day BUILD_PENDING_OUTDATED_TIMEOUT = 1.day
...@@ -23,10 +23,7 @@ class StuckCiBuildsWorker ...@@ -23,10 +23,7 @@ class StuckCiBuildsWorker
private private
def try_obtain_lease def try_obtain_lease
@uuid = Gitlab::ExclusiveLease.new( @uuid = Gitlab::ExclusiveLease.new(EXCLUSIVE_LEASE_KEY, timeout: 30.minutes).try_obtain
EXCLUSIVE_LEASE_KEY,
timeout: 30.minutes
).try_obtain
end end
def remove_lease def remove_lease
......
...@@ -126,4 +126,4 @@ describe StuckCiBuildsWorker do ...@@ -126,4 +126,4 @@ describe StuckCiBuildsWorker do
worker.perform worker.perform
end end
end end
end end
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment