Browse Source

Force log flushing with SIGUSR2

master
JustAnotherArchivist 3 years ago
parent
commit
7dedf118d6
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      irclog.py

+ 7
- 0
irclog.py View File

@@ -1234,6 +1234,13 @@ async def main():
storage.update_config(config)
loop.add_signal_handler(signal.SIGUSR1, sigusr1_callback)

def sigusr2_callback():
nonlocal storage
logger.info('Got SIGUSR2, forcing log flush')
for channel in storage.files:
storage.files[channel][2] = time.time()
loop.add_signal_handler(signal.SIGUSR2, sigusr2_callback)

await asyncio.gather(irc.run(loop, sigintEvent), webserver.run(sigintEvent), storage.run(loop, sigintEvent))




Loading…
Cancel
Save