This commit is contained in:
Looly 2022-11-08 16:16:49 +08:00
parent 1b7269187a
commit 3eef8aa6ec
3 changed files with 10 additions and 6 deletions

View File

@ -22,7 +22,7 @@ public class DefaultTrustManager extends X509ExtendedTrustManager {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
return new X509Certificate[0];
}
@Override

View File

@ -72,6 +72,10 @@ public class TimingWheel {
this.wheelSize = wheelSize;
this.interval = tickMs * wheelSize;
this.timerTaskLists = new TimerTaskList[wheelSize];
for (int i = 0; i < wheelSize; i++) {
this.timerTaskLists[i] = new TimerTaskList();
}
//currentTime为tickMs的整数倍 这里做取整操作
this.currentTime = currentTime - (currentTime % tickMs);
this.consumer = consumer;
@ -94,11 +98,7 @@ public class TimingWheel {
final int index = (int) (virtualId % wheelSize);
StaticLog.debug("tickMs: {} ------index: {} ------expiration: {}", tickMs, index, expiration);
TimerTaskList timerTaskList = timerTaskLists[index];
if (null == timerTaskList) {
timerTaskList = new TimerTaskList();
timerTaskLists[index] = timerTaskList;
}
final TimerTaskList timerTaskList = timerTaskLists[index];
timerTaskList.addTask(timerTask);
if (timerTaskList.setExpiration(virtualId * tickMs)) {
//添加到delayQueue中

View File

@ -0,0 +1,4 @@
cn.hutool.http.client.engine.httpclient5.HttpClient5Engine
cn.hutool.http.client.engine.httpclient4.HttpClient4Engine
cn.hutool.http.client.engine.okhttp.OkHttpEngine
cn.hutool.http.client.engine.jdk.JdkClientEngine