From d044e798515fa0445c874fbdfcbe5395d35915ad Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 8 Sep 2023 04:26:53 +0000 Subject: [PATCH] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- .../plugins/alerting/server/alerts_client/alerts_client.ts | 5 ++--- .../server/alerts_client/lib/alert_conflict_resolver.ts | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts index ae328016dd909..09afee30106e2 100644 --- a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts @@ -48,7 +48,6 @@ import { getLifecycleAlertsQueries, getContinualAlertsQuery, } from './lib'; -import { resolveAlertConflicts } from './lib/alert_conflict_resolver'; // Term queries can take up to 10,000 terms const CHUNK_SIZE = 10000; @@ -413,11 +412,11 @@ export class AlertsClient< } alerts - ${JSON.stringify(errorsInResponse)}` ); - //resolveAlertConflicts({ + // resolveAlertConflicts({ // bulkRequest: bulkBody, // bulkResponse: response, // esClient, - //}); + // }); } } catch (err) { this.options.logger.error( diff --git a/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts index ed692bfafd035..6107eba3d7a96 100644 --- a/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts +++ b/x-pack/plugins/alerting/server/alerts_client/lib/alert_conflict_resolver.ts @@ -38,16 +38,13 @@ export async function resolveAlertConflicts( const bulkRequest = { operations: conflictRequest.map((req) => [req.op, req.doc]).flat(), - } + }; return { bulkRequest }; } - // change this to do the mget separately from applying the OCC, // so we can also use the mget to get the current ad-hoc fields of the alert - - /** Update the OCC info in the request via mget. */ async function updateOCC(esClient: ElasticsearchClient, conflictRequests: NormalizedBulkRequest[]) { const docs: Array<{ _id: string; _index: string }> = [];