From b71a52c9f8ce739990d0cd360fc4d89d92a80b83 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Mon, 13 Nov 2023 16:49:18 +0100 Subject: [PATCH] [Synthetics] Supress API key errors when we have no monitors (#171085) --- .../synthetics/server/synthetics_service/synthetics_service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts index aabedbe96443b..1602a7d29f12f 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/synthetics_service.ts @@ -423,6 +423,9 @@ export class SyntheticsService { }; for await (const result of finder.find()) { + if (result.saved_objects.length === 0) { + return; + } try { if (!output) { output = await this.getOutput();