feat(shipping-notice): 增加 RPA Worker 心跳上报与状态查询功能
This commit is contained in:
1 parent
c3f05ba96b
commit
5a147c4d85
49 files changed
+4032
-1500
No files matched your search
@@ -9,6 +9,7 @@ from sqlalchemy.orm import joinedload
|
||||
from app import db
|
||||
from app.models import ScheduleRun, ScheduleTask
|
||||
from app.core.response import utc_iso
|
||||
from app.services.schedule.shipping_inventory_rpa_archive import inventory_raw_zip_available_from_summary
|
||||
from app.services.schedule.timezone_util import (
|
||||
DEFAULT_SCHEDULE_TIMEZONE,
|
||||
compute_next_run_at,
|
||||
@@ -59,6 +60,7 @@ def serialize_task(task: ScheduleTask, *, last_status: str | None = None) -> dic
|
||||
|
||||
|
||||
def serialize_run(run: ScheduleRun) -> dict:
|
||||
summary = run.response_summary_json if isinstance(run.response_summary_json, dict) else {}
|
||||
return {
|
||||
'id': run.id,
|
||||
'run_no': run.run_no,
|
||||
@@ -82,6 +84,7 @@ def serialize_run(run: ScheduleRun) -> dict:
|
||||
'error_message': run.error_message,
|
||||
'excel_file_name': run.excel_file_name,
|
||||
'excel_file_size': run.excel_file_size,
|
||||
'inventory_raw_zip_available': inventory_raw_zip_available_from_summary(summary),
|
||||
'kb_sync_status': run.kb_sync_status,
|
||||
'kb_group_id': run.kb_group_id,
|
||||
'kb_document_id': run.kb_document_id,
|
||||
|
||||
Reference in new issue
Block a user