Skip to content
File

Blob: src/worker/dispatch/workflows/step-config.ts

typescript22 lines
1const CONTROL_PLANE_STEP_RETRY_LIMIT = 3;
2const CONTROL_PLANE_STEP_RETRY_DELAY_MS = 1_000;
3const CONTROL_PLANE_STEP_TIMEOUT_MS = 30_000;
4 
5// Cloudflare Workflows: retries.limit = total attempts (not retries). limit: 1 = one attempt, zero retries.
6export const noRetryStepConfig = (timeoutMs = 10 * 60 * 1_000) => ({
7 retries: {
8 limit: 1,
9 delay: CONTROL_PLANE_STEP_RETRY_DELAY_MS,
10 },
11 timeout: timeoutMs,
12});
13 
14export const boundedRetryStepConfig = (timeoutMs = CONTROL_PLANE_STEP_TIMEOUT_MS) => ({
15 retries: {
16 limit: CONTROL_PLANE_STEP_RETRY_LIMIT,
17 delay: CONTROL_PLANE_STEP_RETRY_DELAY_MS,
18 backoff: "constant" as const,
19 },
20 timeout: timeoutMs,
21});