Commit 3aae94de by lepdou

portal use ApolloThreadFactory to create thread

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