-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix alarm time span match in silence and notice #1318
Conversation
boolean endMatch = alertSilence.getPeriodEnd() == null || | ||
nowDate.isBefore(alertSilence.getPeriodEnd().toLocalDateTime()); | ||
if (startMatch && endMatch) { | ||
int times = alertSilence.getTimes() == null ? 0 : alertSilence.getTimes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int times = Optional.ofNullable(alertSilence.getTimes()).orElse(0);
nowTime.isAfter(alertSilence.getPeriodStart().toLocalTime()); | ||
boolean endMatch = alertSilence.getPeriodEnd() == null || | ||
nowTime.isBefore(alertSilence.getPeriodEnd().toLocalTime()); | ||
if (startMatch && endMatch) { | ||
int times = alertSilence.getTimes() == null ? 0 : alertSilence.getTimes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int times = Optional.ofNullable(alertSilence.getTimes()).orElse(0);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个地方可不可以用Optional
收到 已更新 |
Received Updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍👍
What's changed?
bugfix alarm time span match in silence and notice
Checklist