dragon-zhang commented on code in PR #3482:
URL: https://github.com/apache/incubator-shenyu/pull/3482#discussion_r889450777
##########
shenyu-plugin/shenyu-plugin-sofa/src/main/java/org/apache/shenyu/plugin/sofa/cache/ApplicationConfigCache.java:
##########
@@ -108,6 +123,52 @@ public void init(final SofaRegisterConfig
sofaRegisterConfig) {
registryConfig.setRegister(false);
registryConfig.setAddress(sofaRegisterConfig.getRegister());
}
+ if (StringUtils.isNotBlank(sofaRegisterConfig.getThreadpool())) {
+ initThreadPool(sofaRegisterConfig);
+ setAsyncRuntimeThreadPool();
+ }
+ }
+
+ /**
+ * Set sofa asyncRuntime thread pool.
+ */
+ private void setAsyncRuntimeThreadPool() {
+ if (Objects.nonNull(threadPool)) {
+ Field field = ReflectionUtils.findField(AsyncRuntime.class,
"asyncThreadPool");
+ ReflectionUtils.makeAccessible(field);
Review Comment:
Using `java.util.Optional` to add null judgment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]