We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b84e1a commit ff5eac0Copy full SHA for ff5eac0
src/lib/server/workflow/index.ts
@@ -81,6 +81,7 @@ export class Workflow {
81
82
await flow.createSnapshot(flow.flow.getSnapshot().context);
83
flow.flow.start();
84
+ await flow.createSnapshot(flow.flow.getSnapshot().context);
85
await DatabaseWrites.productTransitions.create({
86
data: {
87
ProductId: productId,
src/lib/server/workflow/state-machine.ts
@@ -305,7 +305,11 @@ export const WorkflowStateMachine = setup({
305
type: BullMQ.JobType.Product_Create,
306
productId: context.productId
307
},
308
- BullMQ.Retry0f600
+ {
309
+ ...BullMQ.Retry0f600,
310
+ // prevent duplicate jobs
311
+ jobId: `${BullMQ.JobType.Product_Create}_${context.productId}`
312
+ }
313
);
314
}
315
],
0 commit comments