Search in sources :

Example 1 with DataSaveRequest

use of net.dzikoysk.funnyguilds.concurrency.requests.DataSaveRequest in project FunnyGuilds by FunnyGuilds.

the class Manager method start.

public void start() {
    if (FunnyGuilds.getInstance().isDisabling()) {
        return;
    }
    if (this.task != null) {
        return;
    }
    FunnyGuilds funnyGuilds = FunnyGuilds.getInstance();
    ConcurrencyManager concurrencyManager = funnyGuilds.getConcurrencyManager();
    long interval = this.getSettings().dataInterval * 60 * 20;
    DataSaveRequest saveRequest = new DataSaveRequest();
    this.task = Bukkit.getScheduler().runTaskTimerAsynchronously(funnyGuilds, () -> concurrencyManager.postRequests(saveRequest), interval, interval);
}
Also used : FunnyGuilds(net.dzikoysk.funnyguilds.FunnyGuilds) ConcurrencyManager(net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager) DataSaveRequest(net.dzikoysk.funnyguilds.concurrency.requests.DataSaveRequest)

Aggregations

FunnyGuilds (net.dzikoysk.funnyguilds.FunnyGuilds)1 ConcurrencyManager (net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager)1 DataSaveRequest (net.dzikoysk.funnyguilds.concurrency.requests.DataSaveRequest)1