Skip to content

Commit

Permalink
logをとる
Browse files Browse the repository at this point in the history
  • Loading branch information
jiikko committed Dec 13, 2022
1 parent 521f2f8 commit 0b601d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/procon_bypass_man/bypass/bypass_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def execute
# シビア
t2 = Thread.new do
bypass = ProconBypassMan::Bypass::ProconToSwitch.new(gadget: @gadget, procon: @procon)
process = BlueGreenProcess.new(worker_instance: bypass, max_work: 550)
process = BlueGreenProcess.new(worker_instance: bypass, max_work: 1000)
loop do
if $will_terminate_token
if $will_terminate_token == WILL_TERMINATE_TOKEN::TERMINATE
Expand Down Expand Up @@ -91,19 +91,27 @@ def execute
end
rescue ProconBypassMan::InterruptForRestart
$will_terminate_token = WILL_TERMINATE_TOKEN::RESTART
ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行します"
BlueGreenProcess.terminate_workers_immediately
ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行しました"
[t1, t2].each(&:join)
ProconBypassMan.logger.debug "[t1, t2].each(&:join)を実行しました"
@gadget&.close
@procon&.close
DRb.stop_service
ProconBypassMan.logger.debug "DRb.stop_serviceを実行しました"
exit! 1 # child processなのでexitしていい
rescue Interrupt
$will_terminate_token = WILL_TERMINATE_TOKEN::TERMINATE
ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行します"
BlueGreenProcess.terminate_workers_immediately
ProconBypassMan.logger.debug "BlueGreenProcess.terminate_workers_immediatelyを実行しました"
[t1, t2].each(&:join)
ProconBypassMan.logger.debug "[t1, t2].each(&:join)を実行しました"
@gadget&.close
@procon&.close
DRb.stop_service
ProconBypassMan.logger.debug "DRb.stop_serviceを実行しました"
exit! 1 # child processなのでexitしていい
end
end
Expand Down

0 comments on commit 0b601d9

Please sign in to comment.