Class: Ci::UnlockPipelineService
- Inherits:
-
Object
- Object
- Ci::UnlockPipelineService
- Includes:
- BaseServiceUtility, Gitlab::ExclusiveLeaseHelpers
- Defined in:
- app/services/ci/unlock_pipeline_service.rb
Constant Summary collapse
- ExecutionTimeoutError =
Class.new(StandardError)
- BATCH_SIZE =
100- MAX_EXEC_DURATION =
10.minutes.freeze
- LOCK_TIMEOUT =
(MAX_EXEC_DURATION + 1.minute).freeze
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(pipeline) ⇒ UnlockPipelineService
constructor
A new instance of UnlockPipelineService.
Methods included from Gitlab::ExclusiveLeaseHelpers
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(pipeline) ⇒ UnlockPipelineService
Returns a new instance of UnlockPipelineService.
14 15 16 17 18 19 20 21 |
# File 'app/services/ci/unlock_pipeline_service.rb', line 14 def initialize(pipeline) @pipeline = pipeline @already_leased = false @already_unlocked = false @exec_timeout = false @unlocked_job_artifacts_count = 0 @unlocked_pipeline_artifacts_count = 0 end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/services/ci/unlock_pipeline_service.rb', line 23 def execute unlock_pipeline_exclusively success( skipped_already_leased: already_leased, skipped_already_unlocked: already_unlocked, exec_timeout: exec_timeout, unlocked_job_artifacts: unlocked_job_artifacts_count, unlocked_pipeline_artifacts: unlocked_pipeline_artifacts_count ) end |