Class: Ci::UpdateBuildStateService
- Inherits:
-
Object
- Object
- Ci::UpdateBuildStateService
- Includes:
- Gitlab::ExclusiveLeaseHelpers, Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/ci/update_build_state_service.rb
Defined Under Namespace
Classes: Result
Constant Summary collapse
- InvalidTraceError =
Class.new(StandardError)
- ACCEPT_TIMEOUT =
5.minutes.freeze
Constants included from Gitlab::ExclusiveLeaseHelpers
Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(build, params, metrics = ::Gitlab::Ci::Trace::Metrics.new) ⇒ UpdateBuildStateService
constructor
A new instance of UpdateBuildStateService.
Methods included from Gitlab::ExclusiveLeaseHelpers
Constructor Details
#initialize(build, params, metrics = ::Gitlab::Ci::Trace::Metrics.new) ⇒ UpdateBuildStateService
Returns a new instance of UpdateBuildStateService.
15 16 17 18 19 |
# File 'app/services/ci/update_build_state_service.rb', line 15 def initialize(build, params, metrics = ::Gitlab::Ci::Trace::Metrics.new) @build = build @params = params @metrics = metrics end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
13 14 15 |
# File 'app/services/ci/update_build_state_service.rb', line 13 def build @build end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
13 14 15 |
# File 'app/services/ci/update_build_state_service.rb', line 13 def metrics @metrics end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
13 14 15 |
# File 'app/services/ci/update_build_state_service.rb', line 13 def params @params end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/services/ci/update_build_state_service.rb', line 21 def execute unless accept_available? return update_build_state! end ensure_pending_state! in_build_trace_lock do process_build_state! end end |