Skip to content

Commit

Permalink
IRCボット:シグナルハンドラでスレッドを作らない
Browse files Browse the repository at this point in the history
mcinchを導入したことで不要になった。
  • Loading branch information
ochaochaocha3 committed May 30, 2020
1 parent 49d4cb5 commit 3405c6f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/rgrb/exec/irc_bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ def set_signal_handler(bot, quit)
# 新しい Thread で包む
%i(SIGINT SIGTERM).each do |signal|
Signal.trap(signal) do
Thread.new(signal) do |sig|
bot.quit(quit.empty? ? "Caught #{sig}" : quit)
end
bot.quit(quit.empty? ? "Caught #{signal}" : quit)
end
end
end
Expand Down

0 comments on commit 3405c6f

Please sign in to comment.