自动排程处理笔数逻辑修正

This commit is contained in:
hugo committed 2026-05-18 18:36:35 +08:00
1 parent 3d4b2647ae
commit f978a8701b
10 files changed
+236 -74

No files matched your search

+3 -2
View File
@@ -10,7 +10,7 @@ from app import db
from app.models import Agent, ScheduleRun, ScheduleTask
from app.services.schedule.srm_service import run_rohs_doc_check_dify_job
ScheduleExecuteResult = tuple[int, int, int, list[dict[str, Any]], list[str]]
ScheduleExecuteResult = tuple[int, int, int, int, list[dict[str, Any]], list[str]]
ScheduleExecutor = Callable[[ScheduleTask, ScheduleRun], ScheduleExecuteResult]
@@ -71,7 +71,7 @@ def _run_common_executor(task: ScheduleTask, run: ScheduleRun) -> ScheduleExecut
total = int(summary.get("total_count") if summary.get("total_count") is not None else (len(details) or 1))
success = int(summary.get("success_count") if summary.get("success_count") is not None else total)
failed = int(summary.get("failed_count") if summary.get("failed_count") is not None else max(0, total - success))
return total, success, failed, details, [str(e) for e in errors if str(e).strip()]
return total, success, failed, 0, details, [str(e) for e in errors if str(e).strip()]
def _run_srm_rohs_doc_check_executor(task: ScheduleTask, run: ScheduleRun) -> ScheduleExecuteResult:
@@ -107,6 +107,7 @@ def _run_srm_rohs_doc_check_executor(task: ScheduleTask, run: ScheduleRun) -> Sc
agent=agent,
user=str(getattr(task.owner, "username", "") or task.owner_user_id or "schedule_system"),
wait_seconds=task.wait_seconds or 120,
run_id=run.id,
)