From f4991dd920a58d4ab139f40ea621aa8348bb4aea Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Tue, 19 May 2026 16:36:48 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20presence=20window=2024h=20=E2=86=92=2010?= =?UTF-8?q?min=20to=20match=20cron=20heartbeat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bot green dot stays on for 10 minutes after each successful health check (2× the ~5-min cron cycle). A failed check sets last_poll to 1 hour in the past, going offline immediately. If the cron stops entirely, the dot goes offline on its own after 10 minutes. Co-Authored-By: Claude Sonnet 4.6 --- addons/activeblue_ai/models/ab_ai_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/activeblue_ai/models/ab_ai_bot.py b/addons/activeblue_ai/models/ab_ai_bot.py index e45ab17..3847610 100644 --- a/addons/activeblue_ai/models/ab_ai_bot.py +++ b/addons/activeblue_ai/models/ab_ai_bot.py @@ -172,8 +172,8 @@ class AbAiBot(models.Model): # When online: set both 24h ahead so the bot stays "online" regardless of # cron timing. The cron explicitly marks offline by setting them to the past. if online: - poll_time = now + timedelta(hours=24) - presence_time = now + timedelta(hours=24) + poll_time = now + timedelta(minutes=10) + presence_time = now + timedelta(minutes=10) else: poll_time = now - timedelta(hours=1) presence_time = now - timedelta(hours=1)