Skip to content

Commit

Permalink
Backend Alerding SumState: fix periodic onSetSumState doesn't overrid…
Browse files Browse the repository at this point in the history
…e SumStateSchedule (#2561)

OnSetSumState gets send ~every 5min -> the oldMsg would be constantly updated and therefore would never be send.
This behaviour is fixed by checking if the oldMsg/scheduled message has the same sumState (warning, fault) as the current SumState reported by the Edge.
  • Loading branch information
DerStoecki authored Mar 10, 2024
1 parent a7a3a89 commit 57358f8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ protected void addOrUpdate(Edge edge, Level sumState) {
this.log.warn(ex.getMessage());
}
} else {
oldMsg.setSumState(sumState, this.timeService.now());
if (oldMsg.getSumState() != sumState) {
oldMsg.setSumState(sumState, this.timeService.now());
}
if (!oldMsg.isEmpty()) {
this.msgScheduler.schedule(oldMsg);
}
Expand Down

0 comments on commit 57358f8

Please sign in to comment.