mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-09 12:10:37 +01:00
Add cancel method to metrics.
This commit is contained in:
parent
7968d01259
commit
2e9608c056
@ -635,4 +635,18 @@ public class Metrics {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cancel() {
|
||||||
|
final int taskId;
|
||||||
|
synchronized (optOutLock) {
|
||||||
|
// Is metrics not running.
|
||||||
|
taskId = this.taskId;
|
||||||
|
if (taskId < 0)
|
||||||
|
return;
|
||||||
|
this.taskId = -1;
|
||||||
|
}
|
||||||
|
// Cancel the task.
|
||||||
|
plugin.getServer().getScheduler().cancelTask(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user