auto-sync: 2026-05-17 05:47:11

This commit is contained in:
cfdaily
2026-05-17 05:47:11 +08:00
parent 11252e0f3d
commit 538cc9c0af
2 changed files with 432 additions and 4 deletions
+11 -4
View File
@@ -9,11 +9,13 @@ router = APIRouter(prefix="/api/daemon", tags=["daemon"])
@router.get("/status")
async def daemon_status():
from src.main import _ticker_task, config
from src.main import get_ticker, config
t = get_ticker()
return {
"status": "running",
"version": "2.6.0",
"ticker_running": _ticker_task is not None and not _ticker_task.done(),
"ticker_running": t is not None and t.is_running,
"tick_count": t.tick_count if t else 0,
"config": {
"tick_interval": config.get("daemon", {}).get("tick_interval", 30),
"max_global_agents": config.get("daemon", {}).get("max_global_agents", 5),
@@ -23,5 +25,10 @@ async def daemon_status():
@router.post("/tick")
async def manual_tick():
"""触发手动 tick(占位,F6 实现)"""
return {"ok": True, "message": "Manual tick triggered (placeholder)"}
"""触发手动 tick"""
from src.main import get_ticker
t = get_ticker()
if t is None:
return {"ok": False, "error": "Ticker not initialized"}
result = await t.manual_tick()
return {"ok": True, "result": result}