fix: 自动重置线程计数器

Signed-off-by: 502647092 <admin@yumc.pw>
dev
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
public void onDisable() {
NetworkManager.unregister();
tt.cancel();
}
@Override
@ -114,6 +113,9 @@ public class Yum extends JavaPlugin {
// 需要在主线程注册任务
if (ConfigManager.i().isMainThreadCheck() && mainThread != null) {
PluginKit.scp("§aIO管理系统已启用...");
if (tt != null) {
tt.cancel();
}
task.scheduleAtFixedRate(tt = new MainThreadCheckTask(mainThread), 0, 5000);
}
}

View File

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