File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
references/v3-catalog/src/trigger Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ import { setTimeout } from "node:timers/promises";
1616
1717export const batchParentTask = task ( {
1818 id : "batch-parent-task" ,
19- run : async ( ) => {
20- const items = Array . from ( { length : 10 } , ( _ , i ) => ( {
19+ run : async ( payload : { size ?: number ; wait ?: boolean } ) => {
20+ const items = Array . from ( { length : payload . size ?? 10 } , ( _ , i ) => ( {
2121 payload : {
2222 id : `item${ i } ` ,
2323 name : `Item Name ${ i } ` ,
@@ -44,7 +44,9 @@ export const batchParentTask = task({
4444 } ,
4545 } ) ) ;
4646
47- return await batchChildTask . batchTrigger ( items ) ;
47+ return payload . wait
48+ ? await batchChildTask . batchTriggerAndWait ( items . map ( ( i ) => ( { payload : i . payload } ) ) )
49+ : await batchChildTask . batchTrigger ( items ) ;
4850 } ,
4951} ) ;
5052
You can’t perform that action at this time.
0 commit comments