Skip to content

Commit a671b96

Browse files
committed
Fix createBatch interception from calling this.create
1 parent da3fb2b commit a671b96

File tree

2 files changed

+5
-3
lines changed
  • fixtures/vitest-pool-workers-examples/workflows/src
  • packages/vitest-pool-workers/src/worker

2 files changed

+5
-3
lines changed

fixtures/vitest-pool-workers-examples/workflows/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export class TestWorkflow extends WorkflowEntrypoint<Env> {
1919

2020
export class TestLongWorkflow extends WorkflowEntrypoint<Env, Params> {
2121
async run(event: Readonly<WorkflowEvent<unknown>>, step: WorkflowStep) {
22-
console.log("Starting running...");
23-
2422
await step.sleep("sleep for a while", "10 seconds");
2523

2624
await step.do(

packages/vitest-pool-workers/src/worker/workflows.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ export async function introspectWorkflow(
187187
introspectAndModifyInstance(options.id)
188188
)
189189
);
190-
return target[property](argArray[0]);
190+
191+
const createPromises = (argArray[0] ?? []).map(
192+
(arg: WorkflowInstanceCreateOptions) => target["create"](arg)
193+
);
194+
return Promise.all(createPromises);
191195
},
192196
});
193197
}

0 commit comments

Comments
 (0)