@@ -350,9 +350,8 @@ async function runBatch<Params extends RuleParams>({
350350 let scheduledIds : string [ ] = [ ] ;
351351 const survivingEnabledIds = survivingEnabled . map ( ( p ) => p . id ) ;
352352 try {
353- const scheduledTasks = await withSpan (
354- { name : 'runBatch.bulkSchedule' , type : 'tasks' } ,
355- ( ) => context . taskManager . bulkSchedule ( tasksToSchedule )
353+ const scheduledTasks = await withSpan ( { name : 'runBatch.bulkSchedule' , type : 'tasks' } , ( ) =>
354+ context . taskManager . bulkSchedule ( tasksToSchedule )
356355 ) ;
357356 scheduledIds = scheduledTasks . map ( ( task ) => task . id ) ;
358357 } catch ( error ) {
@@ -421,13 +420,11 @@ async function runBatch<Params extends RuleParams>({
421420 const createTime = Date . now ( ) ;
422421 let bulkResponse ;
423422 try {
424- bulkResponse = await withSpan (
425- { name : 'runBatch.bulkCreateRulesSo' , type : 'rules' } ,
426- ( ) =>
427- bulkCreateRulesSo ( {
428- savedObjectsClient : context . unsecuredSavedObjectsClient ,
429- bulkCreateRuleAttributes : bulkObjects ,
430- } )
423+ bulkResponse = await withSpan ( { name : 'runBatch.bulkCreateRulesSo' , type : 'rules' } , ( ) =>
424+ bulkCreateRulesSo ( {
425+ savedObjectsClient : context . unsecuredSavedObjectsClient ,
426+ bulkCreateRuleAttributes : bulkObjects ,
427+ } )
431428 ) ;
432429 } catch ( error ) {
433430 // Whole-call SO failure: invalidate keys, best-effort task cleanup.
0 commit comments