feat(client): add digital sync retry details
This commit is contained in:
@@ -71,6 +71,8 @@ interface QimingclawSyncFailure {
|
||||
operation: string;
|
||||
attempts: number;
|
||||
lastAttemptAt: string | null;
|
||||
nextRetryAt?: string | null;
|
||||
dueForRetry?: boolean;
|
||||
error: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@@ -392,7 +394,12 @@ function compactSyncText(value?: string | null): string {
|
||||
function syncFailureLine(failure: QimingclawSyncFailure): string {
|
||||
const error = compactSyncText(failure.error);
|
||||
const detail = error.length > 120 ? `${error.slice(0, 120)}...` : error;
|
||||
return `${failure.entityType}/${failure.operation} ${failure.id} 重试 ${failure.attempts} 次${detail ? `,${detail}` : ''}`;
|
||||
const retryText = failure.dueForRetry
|
||||
? '等待补偿'
|
||||
: failure.nextRetryAt
|
||||
? `下次重试 ${failure.nextRetryAt}`
|
||||
: '等待重试';
|
||||
return `${failure.entityType}/${failure.operation} ${failure.id} 重试 ${failure.attempts} 次,${retryText}${detail ? `,${detail}` : ''}`;
|
||||
}
|
||||
|
||||
function withRuntimePlan(plan: DebugPlan, snapshot: QimingclawSnapshot | null): DebugPlan {
|
||||
|
||||
Reference in New Issue
Block a user