Merge pull request #577 from pikasTech/fix-agentrun-gitmirror-retry-1823
fix: use agentrun git mirror local backoff helper
This commit is contained in:
@@ -3964,7 +3964,7 @@ async function runYamlLaneGitMirrorSyncJob(config: UniDeskConfig, spec: AgentRun
|
||||
attempts.push({ attempt, retryLabel: `${attempt}/${AGENTRUN_GIT_MIRROR_RETRY_MAX_ATTEMPTS}`, jobName, ok: false, phase: "create-job", retryableFailure, retryExhausted: retryableFailure !== null && record(retryableFailure).retryExhausted === true });
|
||||
if (retryableFailure !== null && record(retryableFailure).retryExhausted !== true) {
|
||||
progressEvent("agentrun.yaml-lane.git-mirror.retry", retryableFailure);
|
||||
await sleep(numberOrNull(record(retryableFailure).retryBackoffMs) ?? agentRunGitMirrorRetryDelayMs(attempt));
|
||||
await sleep(agentRunGitMirrorRetryDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
return { ...result, retryableFailure, retry: agentRunGitMirrorRetrySummary(attempts) };
|
||||
@@ -3998,7 +3998,7 @@ async function runYamlLaneGitMirrorSyncJob(config: UniDeskConfig, spec: AgentRun
|
||||
attempts.push({ attempt, retryLabel: `${attempt}/${AGENTRUN_GIT_MIRROR_RETRY_MAX_ATTEMPTS}`, jobName, ok: false, polls, elapsedMs: Date.now() - startedAt, retryableFailure, retryExhausted: retryableFailure !== null && record(retryableFailure).retryExhausted === true });
|
||||
if (retryableFailure !== null && record(retryableFailure).retryExhausted !== true) {
|
||||
progressEvent("agentrun.yaml-lane.git-mirror.retry", retryableFailure);
|
||||
await sleep(numberOrNull(record(retryableFailure).retryBackoffMs) ?? agentRunGitMirrorRetryDelayMs(attempt));
|
||||
await sleep(agentRunGitMirrorRetryDelayMs(attempt));
|
||||
break;
|
||||
}
|
||||
return { ...result, retryableFailure, retry: agentRunGitMirrorRetrySummary(attempts) };
|
||||
@@ -4011,7 +4011,7 @@ async function runYamlLaneGitMirrorSyncJob(config: UniDeskConfig, spec: AgentRun
|
||||
attempts.push({ attempt, retryLabel: `${attempt}/${AGENTRUN_GIT_MIRROR_RETRY_MAX_ATTEMPTS}`, jobName, ok: false, polls, elapsedMs: Date.now() - startedAt, degradedReason: "git-mirror-sync-job-timeout", retryableFailure, retryExhausted: retryableFailure !== null && record(retryableFailure).retryExhausted === true });
|
||||
if (retryableFailure !== null && record(retryableFailure).retryExhausted !== true) {
|
||||
progressEvent("agentrun.yaml-lane.git-mirror.retry", retryableFailure);
|
||||
await sleep(numberOrNull(record(retryableFailure).retryBackoffMs) ?? agentRunGitMirrorRetryDelayMs(attempt));
|
||||
await sleep(agentRunGitMirrorRetryDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
return { ...result, retryableFailure, retry: agentRunGitMirrorRetrySummary(attempts) };
|
||||
@@ -5406,7 +5406,7 @@ async function runGitMirrorJob(config: UniDeskConfig, action: "sync" | "flush",
|
||||
attempts.push({ attempt, retryLabel: `${attempt}/${AGENTRUN_GIT_MIRROR_RETRY_MAX_ATTEMPTS}`, jobName, ok: false, phase: "create-job", retryableFailure, retryExhausted: retryableFailure !== null && record(retryableFailure).retryExhausted === true });
|
||||
if (retryableFailure !== null && record(retryableFailure).retryExhausted !== true) {
|
||||
progressEvent(`agentrun.git-mirror.${action}.retry`, retryableFailure);
|
||||
await sleep(numberOrNull(record(retryableFailure).retryBackoffMs) ?? agentRunGitMirrorRetryDelayMs(attempt));
|
||||
await sleep(agentRunGitMirrorRetryDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
const status = await gitMirrorStatus(config, { full: false, raw: false, node: spec.nodeId, lane: spec.lane });
|
||||
@@ -5457,7 +5457,7 @@ async function runGitMirrorJob(config: UniDeskConfig, action: "sync" | "flush",
|
||||
attempts.push({ attempt, retryLabel: `${attempt}/${AGENTRUN_GIT_MIRROR_RETRY_MAX_ATTEMPTS}`, jobName, ok: false, wait, retryableFailure, retryExhausted: retryableFailure !== null && record(retryableFailure).retryExhausted === true });
|
||||
if (retryableFailure !== null && record(retryableFailure).retryExhausted !== true) {
|
||||
progressEvent(`agentrun.git-mirror.${action}.retry`, retryableFailure);
|
||||
await sleep(numberOrNull(record(retryableFailure).retryBackoffMs) ?? agentRunGitMirrorRetryDelayMs(attempt));
|
||||
await sleep(agentRunGitMirrorRetryDelayMs(attempt));
|
||||
continue;
|
||||
}
|
||||
const status = await gitMirrorStatus(config, { full: false, raw: false, node: spec.nodeId, lane: spec.lane });
|
||||
|
||||
Reference in New Issue
Block a user