Class: Ci::Runners::UpdateRunnerService
- Inherits:
-
Object
- Object
- Ci::Runners::UpdateRunnerService
- Includes:
- Gitlab::InternalEventsTracking
- Defined in:
- app/services/ci/runners/update_runner_service.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #execute(params) ⇒ Object
-
#initialize(current_user, runner) ⇒ UpdateRunnerService
constructor
A new instance of UpdateRunnerService.
Methods included from Gitlab::InternalEventsTracking
Constructor Details
#initialize(current_user, runner) ⇒ UpdateRunnerService
Returns a new instance of UpdateRunnerService.
10 11 12 13 |
# File 'app/services/ci/runners/update_runner_service.rb', line 10 def initialize(current_user, runner) @current_user = current_user @runner = runner end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
8 9 10 |
# File 'app/services/ci/runners/update_runner_service.rb', line 8 def current_user @current_user end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
8 9 10 |
# File 'app/services/ci/runners/update_runner_service.rb', line 8 def runner @runner end |
Instance Method Details
#execute(params) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/ci/runners/update_runner_service.rb', line 15 def execute(params) params[:active] = !params.delete(:paused) if params.include?(:paused) if runner.update(params) track_runner_event(params) runner.tick_runner_queue ServiceResponse.success else ServiceResponse.error(message: runner.errors.) end end |