Fix autodumping of logs and add dumping at exit

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2022-07-17 16:50:21 +03:00
parent 1da47dc34e
commit 6e4511d584
Signed by untrusted user who does not match committer: ari
GPG key ID: A50D5B4B599AF8A2

View file

@ -259,7 +259,7 @@ def chatlog_entry(message: str, user: str, header: Optional[str] = None) -> None
_time: str = generate_time_str()
if len(STATE["chatlog"]) > CONFIG["chatlog-limit"]:
if CONFIG["autodump-chatlog"]:
if CONFIG["autodump-chatlogs"]:
dump_log(_time)
STATE["chatlog"].clear()
@ -960,6 +960,9 @@ async def main() -> int:
save_config()
if CONFIG["autodump-chatlogs"]:
log(f"Dumped log: {dump_log(generate_time_str())!r}")
await s.close()
return 0