Class: FunCi::Pipeline::BackgroundWrapper
- Inherits:
-
Object
- Object
- FunCi::Pipeline::BackgroundWrapper
- Defined in:
- lib/fun_ci/pipeline/background_wrapper.rb
Instance Method Summary collapse
-
#initialize(recorder:, job_id:, executor:) ⇒ BackgroundWrapper
constructor
A new instance of BackgroundWrapper.
- #run ⇒ Object
Constructor Details
#initialize(recorder:, job_id:, executor:) ⇒ BackgroundWrapper
Returns a new instance of BackgroundWrapper.
6 7 8 9 10 |
# File 'lib/fun_ci/pipeline/background_wrapper.rb', line 6 def initialize(recorder:, job_id:, executor:) @recorder = recorder @job_id = job_id @executor = executor end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fun_ci/pipeline/background_wrapper.rb', line 12 def run _output, status, timed_out = @executor.call if timed_out @recorder.end_stage(@job_id, "timed_out") @recorder.fail_run elsif status.success? @recorder.end_stage(@job_id, "completed") @recorder.complete_run else @recorder.end_stage(@job_id, "failed") @recorder.fail_run end end |