Skip to content

Commit

Permalink
adding condition where it is working
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed May 4, 2023
1 parent 7e6431e commit 2393faa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x-pack/plugins/alerting/server/task_runner/execution_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,14 @@ export class ExecutionHandler<

// By doing that we are not cancelling the summary action but just waiting
// for the window maintenance to be over before sending the summary action
if (isSummaryAction(action) && this.maintenanceWindowIds.length === 0) {
if (isSummaryAction(action) && this.maintenanceWindowIds.length > 0) {
this.logger.debug(
`no scheduling of summary actions "${action.id}" for rule "${
this.taskInstance.params.alertId
}": has active maintenance windows ${this.maintenanceWindowIds.join()}.`
);
continue;
} else if (isSummaryAction(action)) {
if (summarizedAlerts && summarizedAlerts.all.count !== 0) {
executables.push({ action, summarizedAlerts });
}
Expand All @@ -530,7 +537,7 @@ export class ExecutionHandler<
this.logger.debug(
`no scheduling of actions "${action.id}" for rule "${
this.taskInstance.params.alertId
}": has active maintenance windows ${alert.getMaintenanceWindowIds()}.`
}": has active maintenance windows ${alert.getMaintenanceWindowIds().join()}.`
);
continue;
}
Expand Down

0 comments on commit 2393faa

Please sign in to comment.