Skip to content

Commit ed3b596

Browse files
committed
fix: guard signal handler against duplicate invocations
1 parent 123646f commit ed3b596

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

irc_bot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ def write_starting_date():
156156

157157

158158
def _handle_signal(sig, loop):
159+
for s in (signal.SIGTERM, signal.SIGINT):
160+
loop.remove_signal_handler(s)
159161
_shutdown_logger.info("Received %s, shutting down...", sig.name)
160162
for task in asyncio.all_tasks(loop):
161163
if task is not asyncio.current_task():

0 commit comments

Comments
 (0)