fix: 自动重置线程计数器

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-07-05 19:06:42 +08:00
parent a236157ec3
commit 29d17a43e3
2 changed files with 5 additions and 1 deletions

View File

@ -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);
} }
} }

View File

@ -66,6 +66,8 @@ public class MainThreadCheckTask extends TimerTask {
} else { } else {
stopTime = 0; stopTime = 0;
} }
} else {
stopTime = 0;
} }
} }
} }