debian-mirror-gitlab/app/services/ci/runners/unregister_runner_service.rb
2022-08-27 11:52:29 +05:30

23 lines
570 B
Ruby

# frozen_string_literal: true
module Ci
module Runners
class UnregisterRunnerService
attr_reader :runner, :author
# @param [Ci::Runner] runner the runner to unregister/destroy
# @param [User, authentication token String] author the user or the authentication token that authorizes the removal
def initialize(runner, author)
@runner = runner
@author = author
end
def execute
@runner&.destroy
ServiceResponse.success
end
end
end
end
Ci::Runners::UnregisterRunnerService.prepend_mod