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";
16
16
17
17
export const batchParentTask = task ( {
18
18
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 ) => ( {
21
21
payload : {
22
22
id : `item${ i } ` ,
23
23
name : `Item Name ${ i } ` ,
@@ -44,7 +44,9 @@ export const batchParentTask = task({
44
44
} ,
45
45
} ) ) ;
46
46
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 ) ;
48
50
} ,
49
51
} ) ;
50
52
You can’t perform that action at this time.
0 commit comments