Fix scheduler timezone: use ZoneInfo(settings.scheduler_timezone) not 'local'
This commit is contained in:
@@ -28,6 +28,7 @@ class Settings(BaseSettings):
|
||||
|
||||
# Auto-distillation schedule — override in .env
|
||||
# AUTO_DISTILL=false disables entirely
|
||||
scheduler_timezone: str = "America/Chicago" # IANA tz — set in .env if different
|
||||
auto_distill: bool = True
|
||||
auto_distill_short: bool = True # daily at 03:00 — rolls session logs → MEMORY_SHORT
|
||||
auto_distill_mid: bool = True # weekly Sunday at 03:30 — LLM summarizes short → mid
|
||||
|
||||
@@ -10,6 +10,7 @@ Set AUTO_DISTILL=false to disable entirely.
|
||||
Set AUTO_DISTILL_LONG=true to enable monthly long-term integration.
|
||||
"""
|
||||
import logging
|
||||
from zoneinfo import ZoneInfo
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
from config import settings
|
||||
|
||||
@@ -57,7 +58,7 @@ def start() -> None:
|
||||
logger.info("auto distillation disabled (AUTO_DISTILL=false)")
|
||||
return
|
||||
|
||||
_scheduler = AsyncIOScheduler(timezone="local")
|
||||
_scheduler = AsyncIOScheduler(timezone=ZoneInfo(settings.scheduler_timezone))
|
||||
|
||||
if settings.auto_distill_short:
|
||||
_scheduler.add_job(_run_short, "cron", hour=3, minute=0, id="distill_short")
|
||||
|
||||
Reference in New Issue
Block a user