fix(avatar): prevent BOXIM polling starvation

This commit is contained in:
stefanfeng
2026-09-01 14:03:35 +08:00
parent a7eb6ac2a5
commit 540edb58c4
6 changed files with 196 additions and 11 deletions
+8 -1
View File
@@ -163,7 +163,14 @@ def on_startup():
boxim_client = BoxIMClient(boxim_config)
from services.takeover_service import TakeoverService
takeover_service = TakeoverService(SessionLocal, boxim_client)
takeover_service = TakeoverService(
SessionLocal,
boxim_client,
poll_concurrency=int(os.getenv("BOXIM_POLL_CONCURRENCY", "8")),
max_message_age_seconds=int(
os.getenv("BOXIM_MAX_MESSAGE_AGE_SECONDS", "600")
),
)
poll_interval = max(0.5, float(os.getenv("BOXIM_POLL_INTERVAL_SECONDS", "1")))
takeover_scheduler = AsyncIOScheduler()