debian-mirror-gitlab/app/services/ci/runners/unregister_runner_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
570 B
Ruby
Raw Normal View History

2022-05-07 20:08:51 +05:30
# 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
2022-08-27 11:52:29 +05:30
ServiceResponse.success
2022-05-07 20:08:51 +05:30
end
end
end
end
Ci::Runners::UnregisterRunnerService.prepend_mod