fix checkType errors about module hippo4j-threadpool-adapter-web

pull/1288/head
DDDreame 2 years ago
parent f80f50c82a
commit 486b46dfc4

@ -55,6 +55,7 @@ public class UndertowWebThreadPoolHandlerSupport implements IWebThreadPoolHandle
this.executor = executor; this.executor = executor;
} }
private final long noRejectCount = -1L;
@Override @Override
public ThreadPoolBaseInfo simpleInfo() { public ThreadPoolBaseInfo simpleInfo() {
ThreadPoolBaseInfo poolBaseInfo = new ThreadPoolBaseInfo(); ThreadPoolBaseInfo poolBaseInfo = new ThreadPoolBaseInfo();
@ -122,7 +123,7 @@ public class UndertowWebThreadPoolHandlerSupport implements IWebThreadPoolHandle
stateInfo.setPeakLoad(peakLoad); stateInfo.setPeakLoad(peakLoad);
long rejectCount = fieldObject instanceof DynamicThreadPoolExecutor long rejectCount = fieldObject instanceof DynamicThreadPoolExecutor
? ((DynamicThreadPoolExecutor) fieldObject).getRejectCountNum() ? ((DynamicThreadPoolExecutor) fieldObject).getRejectCountNum()
: -1L; : -noRejectCount;
stateInfo.setRejectCount(rejectCount); stateInfo.setRejectCount(rejectCount);
stateInfo.setClientLastRefreshTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); stateInfo.setClientLastRefreshTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
stateInfo.setTimestamp(System.currentTimeMillis()); stateInfo.setTimestamp(System.currentTimeMillis());

Loading…
Cancel
Save