Skip to content

Commit 4242109

Browse files
committed
Changes from node scripts/check
1 parent d9badae commit 4242109

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

  • x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_create

x-pack/platform/plugins/shared/alerting/server/application/rule/methods/bulk_create/bulk_create_rules.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)