fix commands_dump_loop() and add logging
@@ -138,12 +138,13 @@ class MechaKaren:
while True:
await asyncio.sleep(60)
+ if self.commands:
+ self.logger.info("Dumping commands cache to database...")
+
async with self.commands_lock:
- commands_dump = list(self.comands.items())
+ commands_dump = list(self.commands.items())
self.commands.clear()
- print(commands_dump)
-
await self.db.executemany("UPDATE leaderboards SET commands = commands + $2 WHERE user_id = $1", commands_dump)
async def start(self, pp):
