Add cancel method to metrics.

This commit is contained in:
asofold 2012-12-02 17:33:33 +01:00
parent 7968d01259
commit 2e9608c056

View File

@ -635,4 +635,18 @@ public class Metrics {
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);
}
}