feat(api): add per-task sse throttling and batching for robust updates

This commit is contained in:
che-pj
2025-08-30 09:32:44 +02:00
parent f800251de1
commit f9cf953de1
2 changed files with 85 additions and 17 deletions

View File

@@ -52,6 +52,7 @@ DEFAULT_MAIN_CONFIG = {
"watch": {},
"realTimeMultiplier": 0,
"padNumberWidth": 3,
"sseUpdateIntervalSeconds": 1, # Configurable SSE update interval (default: 1s)
}
@@ -188,7 +189,7 @@ task_annotations = {
"rate_limit": f"{MAX_CONCURRENT_DL}/m",
},
"routes.utils.celery_tasks.trigger_sse_update_task": {
"rate_limit": "500/m", # Allow high rate for real-time SSE updates
"rate_limit": "60/m", # Throttle to 1 update/sec per task (matches SSE throttle)
"default_retry_delay": 1, # Quick retry for SSE updates
"max_retries": 1, # Limited retries for best-effort delivery
"ignore_result": True, # Don't store results for SSE tasks