Commit 94fbc213 by 王祖波

线程池

parent f4a1601e
......@@ -5,6 +5,7 @@ import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.model.ConfigChange;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.gic.commons.util.TraceIdUtil;
import com.gic.haoban.manage.api.qdto.combined.CombinedQDTO;
import com.gic.haoban.manage.service.util.ApolloUtils;
import com.github.benmanes.caffeine.cache.Cache;
......@@ -47,8 +48,8 @@ public class ImageCombined {
.build();
public static final ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(
20,
40,
ApolloUtils.combinedCorePoolSize(),
ApolloUtils.combinedMaximumPoolSize(),
60L,
TimeUnit.SECONDS,
new ArrayBlockingQueue<>(40),
......@@ -59,6 +60,7 @@ public class ImageCombined {
if (!StringUtils.equals(changeEvent.getNamespace(), APPLICATION)) {
return;
}
TraceIdUtil.traceBegin(TraceIdUtil.EntranceType.QUARTZ);
ConfigChange combinedCorePoolSizeChange = changeEvent.getChange("combinedCorePoolSize");
ConfigChange combinedMaximumPoolSizeChange = changeEvent.getChange("combinedMaximumPoolSize");
if ((combinedCorePoolSizeChange != null && combinedCorePoolSizeChange.getNewValue() != null)
......@@ -69,6 +71,7 @@ public class ImageCombined {
EXECUTOR.setCorePoolSize(corePoolSize);
EXECUTOR.setMaximumPoolSize(maximumPoolSize);
}
TraceIdUtil.traceEnd();
}
public static final String IMAGE_REDIS_KEY = "haoban-manage3-service:combined_image:";
......
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