Commit 82ab7b23 authored by lepdou's avatar lepdou

set email.supported.envs default value empty

parent b9ff4798
...@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory; ...@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
...@@ -47,9 +48,17 @@ public class ConfigPublishListener { ...@@ -47,9 +48,17 @@ public class ConfigPublishListener {
@PostConstruct @PostConstruct
public void init() { public void init() {
initEmailSupportedEnvs();
}
private void initEmailSupportedEnvs() {
try { try {
String sendEmailSwitchConfig = String sendEmailSwitchConfig =
serverConfigService.getValue("email.supported.envs", "PRO"); serverConfigService.getValue("email.supported.envs", "");
if (StringUtils.isEmpty(sendEmailSwitchConfig)) {
return;
}
String[] supportedEnvs = sendEmailSwitchConfig.split(","); String[] supportedEnvs = sendEmailSwitchConfig.split(",");
for (String env : supportedEnvs) { for (String env : supportedEnvs) {
...@@ -59,7 +68,6 @@ public class ConfigPublishListener { ...@@ -59,7 +68,6 @@ public class ConfigPublishListener {
logger.error("init email supported envs failed.", e); logger.error("init email supported envs failed.", e);
Tracer.logError("init email supported envs failed.", e); Tracer.logError("init email supported envs failed.", e);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment