File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,9 +24,24 @@ def timeout(check_suite_id)
2424
2525 @logger . info ( "Calling Github::PlanExecution::Finished.new(#{ check_suite . bamboo_ci_ref } ).finished" )
2626
27- Github ::PlanExecution ::Finished . new ( { 'bamboo_ref' => check_suite . bamboo_ci_ref , hanged : true } ) . finished
27+ resp =
28+ Github ::PlanExecution ::Finished
29+ . new ( { 'bamboo_ref' => check_suite . bamboo_ci_ref , hanged : true } )
30+ . finished
2831
29- true
32+ return true if resp == [ 200 , 'Finished' ]
33+
34+ rescheduling ( check_suite_id )
35+ end
36+
37+ def rescheduling ( check_suite_id )
38+ @logger . info ( "Rescheduling check_suite_id: #{ check_suite_id } " )
39+
40+ Delayed ::Job . where ( 'handler LIKE ?' , "%TimeoutExecution%args%-%#{ check_suite_id } %" ) &.delete_all
41+
42+ TimeoutExecution
43+ . delay ( run_at : 2 . hours . from_now . utc , queue : 'timeout_execution' )
44+ . timeout ( check_suite_id )
3045 end
3146 end
3247end
You can’t perform that action at this time.
0 commit comments