Skip to content

Commit

Permalink
Merge pull request #476 from lepdou/bugfix_1206
Browse files Browse the repository at this point in the history
set email.supported.envs default value empty
  • Loading branch information
nobodyiam authored Dec 6, 2016
2 parents b9ff479 + 82ab7b2 commit 1b8a9c9
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -47,9 +48,17 @@ public class ConfigPublishListener {

@PostConstruct
public void init() {
initEmailSupportedEnvs();
}

private void initEmailSupportedEnvs() {
try {
String sendEmailSwitchConfig =
serverConfigService.getValue("email.supported.envs", "PRO");
serverConfigService.getValue("email.supported.envs", "");

if (StringUtils.isEmpty(sendEmailSwitchConfig)) {
return;
}

String[] supportedEnvs = sendEmailSwitchConfig.split(",");
for (String env : supportedEnvs) {
Expand All @@ -59,7 +68,6 @@ public void init() {
logger.error("init email supported envs failed.", e);
Tracer.logError("init email supported envs failed.", e);
}

}


Expand Down

0 comments on commit 1b8a9c9

Please sign in to comment.