yuluo-yx commented on code in PR #2197:
URL: https://github.com/apache/hertzbeat/pull/2197#discussion_r1666214731
##########
alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmSilenceReduce.java:
##########
@@ -101,10 +104,13 @@ public boolean filterSilence(Alert alert) {
if (alertSilence.getDays() != null &&
!alertSilence.getDays().isEmpty()) {
boolean dayMatch =
alertSilence.getDays().stream().anyMatch(item -> item == currentDayOfWeek);
if (dayMatch) {
- LocalTime nowTime = nowDate.toLocalTime();
- boolean startMatch = alertSilence.getPeriodStart()
== null || nowTime.isAfter(alertSilence.getPeriodStart().toLocalTime());
- boolean endMatch = alertSilence.getPeriodEnd() ==
null || nowTime.isBefore(alertSilence.getPeriodEnd().toLocalTime());
- if (startMatch && endMatch) {
+ if (alertSilence.getPeriodStart() == null ||
alertSilence.getPeriodEnd() == null) {
+ continue;
+ }
+ LocalTime silentStart =
alertSilence.getPeriodStart().toLocalTime();
+ LocalTime silentEnd =
alertSilence.getPeriodEnd().toLocalTime();
+ // 判断是否为静默时间段
Review Comment:
Should be translated into Chinese.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]