diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-09-27 08:02:24 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-02 18:08:12 +0300 |
commit | f3348951a80f11b376d5d21843f57102630e1d5d (patch) | |
tree | 5d1d7671fca218c1479e3830741efac3523eb322 /app/workers | |
parent | c6bb038c006f4cfff68666661d3a8fe257c51ed7 (diff) |
Fix coding style offence
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/stuck_ci_jobs_worker.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb index c146db1086b..ab090b96c52 100644 --- a/app/workers/stuck_ci_jobs_worker.rb +++ b/app/workers/stuck_ci_jobs_worker.rb @@ -63,14 +63,6 @@ class StuckCiJobsWorker 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 # `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition. @@ -82,4 +74,12 @@ class StuckCiJobsWorker 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 |