From d5413af4aa99188b85ed08f23d72e2c408fa8db2 Mon Sep 17 00:00:00 2001 From: Surya Sashank Nistala Date: Wed, 10 May 2023 16:32:42 -0700 Subject: [PATCH] log error messages and clean up monitor when indexing doc level queries or metadata creation fails (#900) * log errors and clean up monitor when indexing doc level queries or metadata creation fails * refactor delete monitor action to re-use delete methods Signed-off-by: Surya Sashank Nistala --- .../alerting/transport/TransportDeleteMonitorAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt index 885986ee3..e5f71133d 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteMonitorAction.kt @@ -155,8 +155,8 @@ class TransportDeleteMonitorAction @Inject constructor( monitorId: String, ): DeleteResponse { val deleteResponse = deleteMonitorDocument(client, deleteRequest) - deleteDocLevelMonitorQueriesAndIndices(client, monitor, monitorId) deleteMetadata(client, monitor) + deleteDocLevelMonitorQueriesAndIndices(client, monitor, monitorId) return deleteResponse }