This commit is contained in:
Your Name
2026-04-22 14:13:21 +08:00
parent e0406b5d0e
commit 7cbde2aa78
145 changed files with 23086 additions and 2243 deletions

View File

@@ -6,6 +6,7 @@ from pathlib import Path
from app.core.config import settings
from app.services.debug_event_service import push_debug_event
from app.services.detect_job_service import process_detect_pipeline_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, normalize_systemctl_error, send_worker_command, start_worker, stop_worker
@@ -180,6 +181,16 @@ def runtime_action(action: str, payload: dict | None = None) -> tuple[bool, str,
result = _build_runtime_action_result(action=normalized_action, poll_after_seconds=2, refresh_runtime=True, ok=ok, message=message, data=data)
_emit_runtime_action_event(normalized_action, stage="finished", ok=ok, message=message, data=result)
return ok, message, result
if normalized_action == "process_pipeline":
process_limit = normalized_payload.get("limit")
process_job_id = normalized_payload.get("job_id")
ok, message, data = process_detect_pipeline_now(
limit=int(process_limit or 0) or None,
job_id=int(process_job_id or 0) or None,
)
result = _build_runtime_action_result(action=normalized_action, poll_after_seconds=1, refresh_runtime=True, ok=ok, message=message, data=data)
_emit_runtime_action_event(normalized_action, stage="finished", ok=ok, message=message, data=result)
return ok, message, result
if normalized_action == "start_detection":
command_ok, command_message = send_worker_command(
"start_detection",