From c58fb003f4185d5f6da7700b1953505be63c115c Mon Sep 17 00:00:00 2001 From: Sergey Bahmatov Date: Sat, 29 Mar 2025 15:18:58 +0500 Subject: [PATCH] fix timer_manager --- pomodoro_bot/timer_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pomodoro_bot/timer_manager.py b/pomodoro_bot/timer_manager.py index 2ed6a3d..ff3aad0 100644 --- a/pomodoro_bot/timer_manager.py +++ b/pomodoro_bot/timer_manager.py @@ -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()