fix: 批量任务系统失败重新抛异常以触发 EventBus 重试
Restore InvalidOperationException on system failures after EventBus refactor; use OrderTaskStatusCodes when syncing import tasks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
365f9d8a94
commit
dcf856568e
@ -110,7 +110,11 @@ public sealed class OrderBatchJobProcessor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await RefreshJobSummaryAsync(item.JobId, cancellationToken);
|
await RefreshJobSummaryAsync(item.JobId, cancellationToken);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 系统失败:抛出让 EventBus 重试,耗尽后进 DLX
|
||||||
|
throw new InvalidOperationException(result.FailReason ?? "批量任务系统失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshJobSummaryAsync(int jobId, CancellationToken cancellationToken)
|
private async Task RefreshJobSummaryAsync(int jobId, CancellationToken cancellationToken)
|
||||||
@ -169,11 +173,11 @@ public sealed class OrderBatchJobProcessor(
|
|||||||
|
|
||||||
if (job.Status is OrderBatchJobStatusCodes.Completed or OrderBatchJobStatusCodes.Failed)
|
if (job.Status is OrderBatchJobStatusCodes.Completed or OrderBatchJobStatusCodes.Failed)
|
||||||
{
|
{
|
||||||
task.Status = "completed";
|
task.Status = OrderTaskStatusCodes.Completed;
|
||||||
}
|
}
|
||||||
else if (job.Status == OrderBatchJobStatusCodes.Running)
|
else if (job.Status == OrderBatchJobStatusCodes.Running)
|
||||||
{
|
{
|
||||||
task.Status = "processing";
|
task.Status = OrderTaskStatusCodes.Processing;
|
||||||
}
|
}
|
||||||
|
|
||||||
await orderTaskRepository.UpdateAsync(task, cancellationToken: cancellationToken);
|
await orderTaskRepository.UpdateAsync(task, cancellationToken: cancellationToken);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user