Commit 3aae94de by lepdou

portal use ApolloThreadFactory to create thread

parent e75ad88f
...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists; ...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import com.ctrip.framework.apollo.core.MetaDomainConsts; import com.ctrip.framework.apollo.core.MetaDomainConsts;
import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.core.dto.ServiceDTO;
import com.ctrip.framework.apollo.core.enums.Env; import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory;
import com.ctrip.framework.apollo.tracer.Tracer; import com.ctrip.framework.apollo.tracer.Tracer;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -66,7 +67,8 @@ public class AdminServiceAddressLocator { ...@@ -66,7 +67,8 @@ public class AdminServiceAddressLocator {
rf.setConnectTimeout(DEFAULT_TIMEOUT_MS); rf.setConnectTimeout(DEFAULT_TIMEOUT_MS);
} }
refreshServiceAddressService = Executors.newScheduledThreadPool(1); refreshServiceAddressService =
Executors.newScheduledThreadPool(1, ApolloThreadFactory.create("ServiceLocator", false));
refreshServiceAddressService.schedule(new RefreshAdminServerAddressTask(), 1, TimeUnit.MILLISECONDS); refreshServiceAddressService.schedule(new RefreshAdminServerAddressTask(), 1, TimeUnit.MILLISECONDS);
} }
...@@ -117,8 +119,9 @@ public class AdminServiceAddressLocator { ...@@ -117,8 +119,9 @@ public class AdminServiceAddressLocator {
} catch (Throwable e) { } catch (Throwable e) {
logger.error(String.format("Get admin server address from meta server failed. env: %s, meta server address:%s", logger.error(String.format("Get admin server address from meta server failed. env: %s, meta server address:%s",
env, MetaDomainConsts.getDomain(env)), e); env, MetaDomainConsts.getDomain(env)), e);
Tracer.logError(String.format("Get admin server address from meta server failed. env: %s, meta server address:%s", Tracer
env, MetaDomainConsts.getDomain(env)), e); .logError(String.format("Get admin server address from meta server failed. env: %s, meta server address:%s",
env, MetaDomainConsts.getDomain(env)), e);
} }
} }
return false; return false;
......
...@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.components; ...@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.components;
import com.ctrip.framework.apollo.core.enums.Env; import com.ctrip.framework.apollo.core.enums.Env;
import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory;
import com.ctrip.framework.apollo.portal.api.AdminServiceAPI; import com.ctrip.framework.apollo.portal.api.AdminServiceAPI;
import com.ctrip.framework.apollo.portal.service.ServerConfigService; import com.ctrip.framework.apollo.portal.service.ServerConfigService;
...@@ -58,7 +59,9 @@ public class PortalSettings { ...@@ -58,7 +59,9 @@ public class PortalSettings {
envStatusMark.put(env, true); envStatusMark.put(env, true);
} }
ScheduledExecutorService healthCheckService = Executors.newScheduledThreadPool(1); ScheduledExecutorService
healthCheckService =
Executors.newScheduledThreadPool(1, ApolloThreadFactory.create("EnvHealthChecker", false));
healthCheckService healthCheckService
.scheduleWithFixedDelay(new HealthCheckTask(applicationContext), 1000, HEALTH_CHECK_INTERVAL, .scheduleWithFixedDelay(new HealthCheckTask(applicationContext), 1000, HEALTH_CHECK_INTERVAL,
......
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