🚀 修复告警引擎初始化异常的问题.
This commit is contained in:
@@ -125,6 +125,9 @@ public class AlarmEngineContext {
|
|||||||
* @return rules
|
* @return rules
|
||||||
*/
|
*/
|
||||||
private Map<Long, List<AlarmEngineRule>> getPolicyRules(List<AlarmPolicyRuleDO> list) {
|
private Map<Long, List<AlarmEngineRule>> getPolicyRules(List<AlarmPolicyRuleDO> list) {
|
||||||
|
if (Lists.isEmpty(list)) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
// 转为 map
|
// 转为 map
|
||||||
Map<Long, List<AlarmEngineRule>> ruleMap = Lists.stream(list)
|
Map<Long, List<AlarmEngineRule>> ruleMap = Lists.stream(list)
|
||||||
.map(s -> {
|
.map(s -> {
|
||||||
@@ -154,6 +157,9 @@ public class AlarmEngineContext {
|
|||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
private List<Long> getPolicyEngineNotifier(List<AlarmPolicyNotifyDO> list) {
|
private List<Long> getPolicyEngineNotifier(List<AlarmPolicyNotifyDO> list) {
|
||||||
|
if (Lists.isEmpty(list)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
return list.stream()
|
return list.stream()
|
||||||
.map(AlarmPolicyNotifyDO::getNotifyId)
|
.map(AlarmPolicyNotifyDO::getNotifyId)
|
||||||
.distinct()
|
.distinct()
|
||||||
|
|||||||
Reference in New Issue
Block a user