Fix Celery datetime timezone crash and per-account polling interval
- Wrap account.last_check_at with _as_utc() helper before datetime subtraction to fix "can't subtract offset-naive and offset-aware datetimes" crash that silently prevented all mail account processing - Change beat schedule from every 5 min to every 1 min so accounts configured with check_interval_minutes=1 are polled as expected Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/53169783-5139-43a1-bda8-709fadd0f774 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -510,8 +510,8 @@ async def process_all_enabled_accounts():
|
||||
for account in accounts:
|
||||
# Check if it's time to check this account
|
||||
if account.last_check_at:
|
||||
time_since_last_check = (
|
||||
datetime.now(timezone.utc) - account.last_check_at
|
||||
time_since_last_check = datetime.now(timezone.utc) - _as_utc(
|
||||
account.last_check_at
|
||||
)
|
||||
if time_since_last_check.total_seconds() < (
|
||||
account.check_interval_minutes * 60
|
||||
|
||||
Reference in New Issue
Block a user