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 9169a12
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 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 @@ -90,20 +90,30 @@ def execute
handle_signal(signal)
end
rescue ProconBypassMan::InterruptForRestart
ProconBypassMan.logger.debug '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
ProconBypassMan.logger.debug '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 9169a12

Please sign in to comment.