Commit f3348951 authored by Shinya Maeda's avatar Shinya Maeda Committed by Alessio Caiazza

Fix coding style offence

parent c6bb038c
...@@ -63,14 +63,6 @@ class StuckCiJobsWorker ...@@ -63,14 +63,6 @@ class StuckCiJobsWorker
end end
end end
end end
# rubocop: enable CodeReuse/ActiveRecord
def drop_build(type, build, status, timeout, reason)
Rails.logger.info "#{self.class}: Dropping #{type} build #{build.id} for runner #{build.runner_id} (status: #{status}, timeout: #{timeout}, reason: #{reason})"
Gitlab::OptimisticLocking.retry_lock(build, 3) do |b|
b.drop(reason)
end
end
def drop_stale_scheduled_builds def drop_stale_scheduled_builds
# `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition. # `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition.
...@@ -82,4 +74,12 @@ class StuckCiJobsWorker ...@@ -82,4 +74,12 @@ class StuckCiJobsWorker
end end
end end
end end
# rubocop: enable CodeReuse/ActiveRecord
def drop_build(type, build, status, timeout, reason)
Rails.logger.info "#{self.class}: Dropping #{type} build #{build.id} for runner #{build.runner_id} (status: #{status}, timeout: #{timeout}, reason: #{reason})"
Gitlab::OptimisticLocking.retry_lock(build, 3) do |b|
b.drop(reason)
end
end
end end
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