fix timer_manager
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-29 15:18:58 +05:00
parent a42fef3442
commit c58fb003f4

View File

@@ -12,8 +12,13 @@ class TimerManager:
async def timer():
await asyncio.sleep(duration)
print(f"[DEBUG timer] label={label!r}")
if label == 'Pomodoro':
await user_manager.increment_pomodoros(user_id)
try:
await user_manager.increment_pomodoros(user_id)
print(f"[DEBUG] Pomodoro count incremented for {user_id}")
except Exception as e:
print(f"[ERROR] Failed to increment pomodoros: {e}")
await self.bot.send_message(chat_id, f"{label} завершён!")
loop = asyncio.get_running_loop()