Files
klz-cables.com/.pnpm-store/v10/files/c7/4971608f7a9ec85230dc0ec59396266dba9caee7434553f63583212a0c855cd5040744eb5d2fca35a505d4eeb7755bf35d1d7af4640df774782f0eec803611
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

34 lines
1.2 KiB
Plaintext

import { calculateBackoffWaitUntil } from './calculateBackoffWaitUntil.js';
/**
* Assuming there is no task that has already reached max retries,
* this function determines if the workflow should retry the job
* and if so, when it should retry.
*/ export function getWorkflowRetryBehavior({ job, retriesConfig }) {
const maxWorkflowRetries = typeof retriesConfig === 'object' ? retriesConfig.attempts : retriesConfig;
if (maxWorkflowRetries !== undefined && maxWorkflowRetries !== null && job.totalTried >= maxWorkflowRetries) {
return {
hasFinalError: true,
maxWorkflowRetries
};
}
if (!retriesConfig) {
// No retries provided => assuming no task reached max retries, we can retry
return {
hasFinalError: false,
maxWorkflowRetries: undefined,
waitUntil: undefined
};
}
// Job will retry. Let's determine when!
const waitUntil = calculateBackoffWaitUntil({
retriesConfig,
totalTried: job.totalTried ?? 0
});
return {
hasFinalError: false,
maxWorkflowRetries,
waitUntil
};
}
//# sourceMappingURL=getWorkflowRetryBehavior.js.map