rebuild(migration): validate local legacy cutover

This commit is contained in:
leefer
2026-07-30 17:26:15 +08:00
parent 37bd9fea85
commit 198806c1bd
23 changed files with 418 additions and 27 deletions
+8 -1
View File
@@ -57,7 +57,7 @@ class JobService:
finished_at=finished,
duration_ms=_duration(started, finished),
error_code=type(exc).__name__,
error_message=str(exc) or "任务执行失败",
error_message=_exception_message(exc),
)
raise
finished = datetime.now(SHANGHAI)
@@ -120,3 +120,10 @@ class JobService:
def _duration(started: datetime, finished: datetime) -> int:
return max(0, round((finished - started).total_seconds() * 1000))
def _exception_message(error: Exception) -> str:
message = getattr(error, "message", None)
if isinstance(message, str) and message.strip():
return message.strip()
return str(error).strip() or "任务执行失败"