Skip to content

Commit edaa096

Browse files
committed
Fix retry strategy syntax in tolerated failure examples
- Use retryPresets.noRetry instead of invalid retry config object - Import retryPresets from SDK to disable step retries properly - Resolves TypeScript compilation errors
1 parent e1cb0a3 commit edaa096

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/map/tolerated-failure-count/map-tolerated-failure-count.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4+
retryPresets,
45
} from "@aws/durable-execution-sdk-js";
56
import { ExampleConfig } from "../../../types";
67
import { log } from "../../../utils/logger";
@@ -29,7 +30,7 @@ export const handler = withDurableExecution(
2930
}
3031
return `Item ${item} processed`;
3132
},
32-
{ retry: { maxAttempts: 1 } },
33+
{ retryStrategy: retryPresets.noRetry },
3334
);
3435
},
3536
{

packages/aws-durable-execution-sdk-js-examples/src/examples/map/tolerated-failure-percentage/map-tolerated-failure-percentage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4+
retryPresets,
45
} from "@aws/durable-execution-sdk-js";
56
import { ExampleConfig } from "../../../types";
67
import { log } from "../../../utils/logger";
@@ -30,7 +31,7 @@ export const handler = withDurableExecution(
3031
}
3132
return `Item ${item} processed`;
3233
},
33-
{ retry: { maxAttempts: 1 } },
34+
{ retryStrategy: retryPresets.noRetry },
3435
);
3536
},
3637
{

packages/aws-durable-execution-sdk-js-examples/src/examples/parallel/tolerated-failure-count/parallel-tolerated-failure-count.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4+
retryPresets,
45
} from "@aws/durable-execution-sdk-js";
56
import { ExampleConfig } from "../../../types";
67
import { log } from "../../../utils/logger";
@@ -29,7 +30,7 @@ export const handler = withDurableExecution(
2930
async () => {
3031
throw new Error("Branch 2 failed");
3132
},
32-
{ retry: { maxAttempts: 1 } },
33+
{ retryStrategy: retryPresets.noRetry },
3334
);
3435
},
3536
async (ctx) => {
@@ -43,7 +44,7 @@ export const handler = withDurableExecution(
4344
async () => {
4445
throw new Error("Branch 4 failed");
4546
},
46-
{ retry: { maxAttempts: 1 } },
47+
{ retryStrategy: retryPresets.noRetry },
4748
);
4849
},
4950
async (ctx) => {

packages/aws-durable-execution-sdk-js-examples/src/examples/parallel/tolerated-failure-percentage/parallel-tolerated-failure-percentage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4+
retryPresets,
45
} from "@aws/durable-execution-sdk-js";
56
import { ExampleConfig } from "../../../types";
67
import { log } from "../../../utils/logger";
@@ -29,7 +30,7 @@ export const handler = withDurableExecution(
2930
async () => {
3031
throw new Error("Branch 2 failed");
3132
},
32-
{ retry: { maxAttempts: 1 } },
33+
{ retryStrategy: retryPresets.noRetry },
3334
);
3435
},
3536
async (ctx) => {
@@ -43,7 +44,7 @@ export const handler = withDurableExecution(
4344
async () => {
4445
throw new Error("Branch 4 failed");
4546
},
46-
{ retry: { maxAttempts: 1 } },
47+
{ retryStrategy: retryPresets.noRetry },
4748
);
4849
},
4950
async (ctx) => {

0 commit comments

Comments
 (0)