Skip to content

Commit c0c9dfc

Browse files
Merge pull request #285 from wttech/notifications-skipped-for-health-checker
Notifications skipped for health checker
2 parents 2c94a75 + edcc3f5 commit c0c9dfc

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

core/src/main/java/dev/vml/es/acm/core/code/ExecutionContext.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public static String varPath(String executionId) {
3535

3636
private boolean history = true;
3737

38+
private boolean notifications = true;
39+
3840
private boolean debug = false;
3941

4042
private boolean skipped = false;
@@ -138,6 +140,14 @@ public void setHistory(boolean history) {
138140
this.history = history;
139141
}
140142

143+
public boolean isNotifications() {
144+
return notifications;
145+
}
146+
147+
public void setNotifications(boolean notifications) {
148+
this.notifications = notifications;
149+
}
150+
141151
public boolean isDebug() {
142152
return debug;
143153
}

core/src/main/java/dev/vml/es/acm/core/code/Executor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ private void handleHistory(ContextualExecution execution) {
298298

299299
private void handleNotifications(ContextualExecution execution) {
300300
String executableId = execution.getExecutable().getId();
301-
if (!config.notificationEnabled()
301+
if (!execution.getContext().isNotifications()
302+
|| !config.notificationEnabled()
302303
|| !notifier.isConfigured(config.notificationNotifierId())
303304
|| Arrays.stream(config.notificationExecutableIds())
304305
.noneMatch(regex -> Pattern.matches(regex, executableId))) {

core/src/main/java/dev/vml/es/acm/core/instance/HealthChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ private void checkCodeExecutor(List<HealthIssue> issues, ResourceResolver resour
259259
resourceResolver,
260260
new CodeOutputMemory())) {
261261
context.setHistory(false);
262+
context.setNotifications(false);
262263

263264
Execution execution = executor.execute(context);
264265
if (execution.getStatus() != ExecutionStatus.SUCCEEDED) {

0 commit comments

Comments
 (0)