Files
fquiz/api/app/tasks/worker_registry_tasks.py
T
chengkai3 f866ee3fa8 fix:[FL-203][调度监控页面执行节点离线巡检日志不要展示]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-28 09:54:03 +08:00

19 lines
571 B
Python

from __future__ import annotations
from ..core.celery_app import celery_app
from ..core.config import get_settings
from ..services.worker_registry_service import sweep_offline_workers
@celery_app.task(
name="app.tasks.worker_registry_tasks.sweep_worker_registry_offline",
ignore_result=True,
track_started=False,
)
def sweep_worker_registry_offline() -> dict[str, int]:
settings = get_settings()
updated_count = sweep_offline_workers(ttl_seconds=settings.worker_registry_ttl_seconds)
return {
"updated_count": int(updated_count),
}