Commit 9b64fa12 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'rename-drop-service' into 'master'

Rename Ci::StuckBuilds::DropService to DropPendingService

See merge request gitlab-org/gitlab!71233
parents 5988f878 721061ea
......@@ -2,7 +2,7 @@
module Ci
module StuckBuilds
class DropService
class DropPendingService
include DropHelpers
BUILD_PENDING_OUTDATED_TIMEOUT = 1.day
......@@ -10,7 +10,7 @@ module Ci
BUILD_LOOKBACK = 5.days
def execute
Gitlab::AppLogger.info "#{self.class}: Cleaning stuck builds"
Gitlab::AppLogger.info "#{self.class}: Cleaning pending timed-out builds"
drop(
pending_builds(BUILD_PENDING_OUTDATED_TIMEOUT.ago),
......
......@@ -20,7 +20,7 @@ class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
Ci::StuckBuilds::DropScheduledWorker.perform_in(40.minutes)
try_obtain_lease do
Ci::StuckBuilds::DropService.new.execute
Ci::StuckBuilds::DropPendingService.new.execute
end
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Ci::StuckBuilds::DropService do
RSpec.describe Ci::StuckBuilds::DropPendingService do
let!(:runner) { create :ci_runner }
let!(:job) { create :ci_build, runner: runner }
let(:created_at) { }
......
......@@ -23,10 +23,10 @@ RSpec.describe StuckCiJobsWorker do
subject
end
it 'executes an instance of Ci::StuckBuilds::DropService' do
it 'executes an instance of Ci::StuckBuilds::DropPendingService' do
expect_to_obtain_exclusive_lease(worker.lease_key, lease_uuid)
expect_next_instance_of(Ci::StuckBuilds::DropService) do |service|
expect_next_instance_of(Ci::StuckBuilds::DropPendingService) do |service|
expect(service).to receive(:execute).exactly(:once)
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