Merge pull request #156 from weihubeats/develop

修复空指针问题
pull/157/merge
龙台 Long Tai 3 years ago committed by GitHub
commit 29f0d1c4a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,9 +1,12 @@
package cn.hippo4j.core.starter.config;
import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm;
import com.google.common.collect.Maps;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Map;
/**
* Executor properties.
*
@ -69,4 +72,9 @@ public class ExecutorProperties {
*/
private ThreadPoolNotifyAlarm notify;
public Map<String, String> receives() {
return this.notify.getReceives() == null ? Maps.newHashMap() : this.notify.getReceives();
}
}

@ -61,7 +61,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder {
notifyConfig.setType("ALARM");
notifyConfig.setSecretKey(platformProperties.getSecretKey());
notifyConfig.setInterval(executor.getNotify().getInterval());
Map<String, String> receives = executor.getNotify().getReceives();
Map<String, String> receives = executor.receives();
String receive = receives.get(platformProperties.getPlatform());
if (StrUtil.isBlank(receive)) {
receive = platformProperties.getReceives();
@ -82,7 +82,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder {
notifyConfig.setType("CONFIG");
notifyConfig.setSecretKey(platformProperties.getSecretKey());
Map<String, String> receives = executor.getNotify().getReceives();
Map<String, String> receives = executor.receives();
String receive = receives.get(platformProperties.getPlatform());
if (StrUtil.isBlank(receive)) {
receive = platformProperties.getReceives();

Loading…
Cancel
Save