diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-09-26 09:15:52 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-02 18:08:11 +0300 |
commit | 20de2480d2431bc4afcd264fbb4aa73baa74a2b4 (patch) | |
tree | 9f2e2f21d8d44776522ae7912131aa651f4a840a /app/workers | |
parent | 6eee8d2d53a327051515ec18953726fd5606c000 (diff) |
Fix stuck ci jobs worker
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/stuck_ci_jobs_worker.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb index 8979596c581..c146db1086b 100644 --- a/app/workers/stuck_ci_jobs_worker.rb +++ b/app/workers/stuck_ci_jobs_worker.rb @@ -76,7 +76,7 @@ class StuckCiJobsWorker # `ci_builds` table has a partial index on `id` with `scheduled_at <> NULL` condition. # Therefore this query's first step uses Index Search, and the following expensive # filter `scheduled_at < ?` will only perform on a small subset (max: 100 rows) - Ci::Build.include(EachBach).where('scheduled_at <> NULL').each_batch(of: 100) do |relation| + Ci::Build.include(EachBatch).where('scheduled_at <> NULL').each_batch(of: 100) do |relation| relation.where('scheduled_at < ?', BUILD_SCHEDULED_OUTDATED_TIMEOUT.ago).find_each do |build| drop_build(:outdated, build, :scheduled, BUILD_SCHEDULED_OUTDATED_TIMEOUT, :schedule_expired) end |