mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-12-23 05:08:47 +00:00
fix: 自动重置线程计数器
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
a236157ec3
commit
29d17a43e3
@ -43,7 +43,6 @@ public class Yum extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
NetworkManager.unregister();
|
NetworkManager.unregister();
|
||||||
tt.cancel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -114,6 +113,9 @@ public class Yum extends JavaPlugin {
|
|||||||
// 需要在主线程注册任务
|
// 需要在主线程注册任务
|
||||||
if (ConfigManager.i().isMainThreadCheck() && mainThread != null) {
|
if (ConfigManager.i().isMainThreadCheck() && mainThread != null) {
|
||||||
PluginKit.scp("§aIO管理系统已启用...");
|
PluginKit.scp("§aIO管理系统已启用...");
|
||||||
|
if (tt != null) {
|
||||||
|
tt.cancel();
|
||||||
|
}
|
||||||
task.scheduleAtFixedRate(tt = new MainThreadCheckTask(mainThread), 0, 5000);
|
task.scheduleAtFixedRate(tt = new MainThreadCheckTask(mainThread), 0, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,8 @@ public class MainThreadCheckTask extends TimerTask {
|
|||||||
} else {
|
} else {
|
||||||
stopTime = 0;
|
stopTime = 0;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
stopTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user