diff options
Diffstat (limited to 'app/services/ci/stuck_builds/drop_running_service.rb')
-rw-r--r-- | app/services/ci/stuck_builds/drop_running_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/ci/stuck_builds/drop_running_service.rb b/app/services/ci/stuck_builds/drop_running_service.rb index c543d8a94db..a79224cc231 100644 --- a/app/services/ci/stuck_builds/drop_running_service.rb +++ b/app/services/ci/stuck_builds/drop_running_service.rb @@ -17,8 +17,11 @@ module Ci def running_timed_out_builds if Feature.enabled?(:ci_new_query_for_running_stuck_jobs, default_enabled: :yaml) - running_builds = Ci::Build.running.created_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago).order(created_at: :asc, project_id: :asc) # rubocop: disable CodeReuse/ActiveRecord - Ci::Build.id_in(running_builds).updated_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago) + Ci::Build + .running + .created_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago) + .updated_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago) + .order(created_at: :asc, project_id: :asc) # rubocop:disable CodeReuse/ActiveRecord else Ci::Build.running.updated_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago) end |