This commit is contained in:
Your Name
2026-04-17 03:36:03 +08:00
parent 3cc36a054c
commit d3223a75a4
5 changed files with 525 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import subprocess
from pathlib import Path
from app.core.config import settings
from app.services.sync_push_service import push_runtime_projection_now
from app.services.sync_push_service import pull_detect_task_batch_now, push_runtime_projection_now
from app.services.runtime_settings_service import get_runtime_settings
from app.services.worker_control_service import _run_systemctl, start_worker, stop_worker
@@ -104,6 +104,14 @@ def runtime_action(action: str) -> tuple[bool, str, dict]:
"refresh_runtime": True,
**(data or {}),
}
if action == "pull_tasks":
ok, message, data = pull_detect_task_batch_now()
return ok, message, {
"action": action,
"poll_after_seconds": 2,
"refresh_runtime": True,
**(data or {}),
}
return False, f"不支持的运行时动作: {action}", {
"action": action,
"poll_after_seconds": 0,