Module: Ocak::ShutdownHandling
- Included in:
- PipelineRunner
- Defined in:
- lib/ocak/shutdown_handling.rb
Overview
Shutdown orchestration logic — graceful/force shutdown, interrupt/error handling, summary. Extracted from PipelineRunner to reduce file size.
Instance Method Summary collapse
Instance Method Details
#print_shutdown_summary ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/ocak/shutdown_handling.rb', line 17 def print_shutdown_summary issues = @active_mutex.synchronize { @interrupted_issues.dup } return if issues.empty? warn "\nInterrupted issues:" issues.each do |issue_number| warn " - Issue ##{issue_number}: ocak resume --issue #{issue_number}" end end |
#shutdown! ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/ocak/shutdown_handling.rb', line 7 def shutdown! count = @active_mutex.synchronize { @shutdown_count += 1 } if count >= 2 force_shutdown! else graceful_shutdown! end end |