fix: presence window 24h → 10min to match cron heartbeat
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user