Skip to content

Commit b73ca8b

Browse files
committed
Added another case to the idempotency test task: multiple of the same idempotencyKey in a single batch
1 parent bd6ee2c commit b73ca8b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

references/hello-world/src/trigger/idempotency.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ export const idempotencyBatch = task({
138138
{
139139
payload: { message: "Hello, world 3", duration: 500, failureChance: 0 },
140140
},
141+
// Include runs in the same batch with the same idempotencyKeys
142+
// I'm sure people will do this, even though it doesn't make sense
143+
{
144+
payload: { message: "Hello, world!" },
145+
options: { idempotencyKey: successfulKey, idempotencyKeyTTL: "120s" },
146+
},
147+
{
148+
payload: { message: "Hello, world 2!" },
149+
options: { idempotencyKey: failureKey, idempotencyKeyTTL: "120s" },
150+
},
141151
...moreItems,
142152
],
143153
{

0 commit comments

Comments
 (0)