From 56008de1dd447b3b4967e9abdea692e1b4036119 Mon Sep 17 00:00:00 2001 From: David Cui <53581635+davidcui1225@users.noreply.github.com> Date: Wed, 27 Oct 2021 16:48:27 -0700 Subject: [PATCH] add check in ReportInstanceActions to fix on demand report creation after report definition creation (#196) Signed-off by: David Cui --- .../opensearch/reportsscheduler/action/ReportInstanceActions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/ReportInstanceActions.kt b/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/ReportInstanceActions.kt index 3030c2df..25220866 100644 --- a/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/ReportInstanceActions.kt +++ b/reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/ReportInstanceActions.kt @@ -124,7 +124,7 @@ internal object ReportInstanceActions { Metrics.REPORT_FROM_DEFINITION_ID_SYSTEM_ERROR.counter.increment() throw OpenSearchStatusException("Report Instance Creation failed", RestStatus.INTERNAL_SERVER_ERROR) } - if (reportDefinitionDetails.reportDefinition.delivery != null) { + if (reportDefinitionDetails.reportDefinition.delivery != null && reportDefinitionDetails.reportDefinition.delivery.configIds.isNotEmpty()) { val reportName = reportInstance.reportDefinitionDetails!!.reportDefinition.name val reportLink = buildReportLink(reportDefinitionDetails.reportDefinition.source.origin, reportInstance.tenant, docId) NotificationsActions.send(reportDefinitionDetails.reportDefinition.delivery, docId, reportLink, reportName)