Merge pull request #140 from LINGLUOJUN/develop

perf:  线程池通知部分优化
pull/142/head
龙台 Long Tai 4 years ago committed by GitHub
commit 24b7b2b0aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.*; import java.util.concurrent.*;
/** /**
@ -134,7 +135,7 @@ public class ThreadPoolNotifyAlarmHandler implements Runnable, CommandLineRunner
*/ */
public void checkPoolRejectedAlarm(String threadPoolId) { public void checkPoolRejectedAlarm(String threadPoolId) {
ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId); ThreadPoolNotifyAlarm threadPoolNotifyAlarm = GlobalNotifyAlarmManage.get(threadPoolId);
if (!threadPoolNotifyAlarm.getIsAlarm()) { if (Objects.isNull(threadPoolNotifyAlarm) || !threadPoolNotifyAlarm.getIsAlarm()) {
return; return;
} }

@ -30,8 +30,10 @@ public class RejectedProxyInvocationHandler implements InvocationHandler {
if (ApplicationContextHolder.getInstance() != null) { if (ApplicationContextHolder.getInstance() != null) {
ThreadPoolNotifyAlarmHandler alarmHandler = ApplicationContextHolder.getBean(ThreadPoolNotifyAlarmHandler.class); ThreadPoolNotifyAlarmHandler alarmHandler = ApplicationContextHolder.getBean(ThreadPoolNotifyAlarmHandler.class);
if (alarmHandler != null) { try {
alarmHandler.checkPoolRejectedAlarm(threadPoolId); alarmHandler.checkPoolRejectedAlarm(threadPoolId);
} catch (Exception ignored) {
//ignored
} }
} }

Loading…
Cancel
Save