Fix autodumping of logs and add dumping at exit
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
1da47dc34e
commit
6e4511d584
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue