Fix data not being loaded sync when the plugin starts

This commit is contained in:
Luck 2016-10-29 21:14:59 +01:00
parent bb6b31d715
commit c0ea2d8ec3
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 9 additions and 9 deletions

View File

@ -211,11 +211,11 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
if (mins > 0) {
long ticks = mins * 60 * 20;
getServer().getScheduler().runTaskTimerAsynchronously(this, () -> updateTaskBuffer.request(), 20L, ticks);
} else {
// Update online users
updateTaskBuffer.request();
}
// run an update instantly.
updateTaskBuffer.requestDirectly();
// register tasks
getServer().getScheduler().runTaskTimer(this, BukkitSenderFactory.get(this), 1L, 1L);
getServer().getScheduler().runTaskTimerAsynchronously(this, new ExpireTemporaryTask(this), 60L, 60L);

View File

@ -164,11 +164,11 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
int mins = getConfiguration().getSyncTime();
if (mins > 0) {
getProxy().getScheduler().schedule(this, new UpdateTask(this), mins, mins, TimeUnit.MINUTES);
} else {
// Update online users
updateTaskBuffer.request();
}
// run an update instantly.
updateTaskBuffer.requestDirectly();
// register tasks
getProxy().getScheduler().schedule(this, BungeeSenderFactory.get(this), 50L, 50L, TimeUnit.MILLISECONDS); // 20 times per second (once per "tick")
getProxy().getScheduler().schedule(this, new ExpireTemporaryTask(this), 3L, 3L, TimeUnit.SECONDS);

View File

@ -206,11 +206,11 @@ public class LPSpongePlugin implements LuckPermsPlugin {
if (mins > 0) {
scheduler.createTaskBuilder().async().interval(mins, TimeUnit.MINUTES).execute(new UpdateTask(this))
.submit(LPSpongePlugin.this);
} else {
// Update online users
updateTaskBuffer.request();
}
// run an update instantly.
updateTaskBuffer.requestDirectly();
// register tasks
scheduler.createTaskBuilder().intervalTicks(1L).execute(SpongeSenderFactory.get(this)).submit(this);
scheduler.createTaskBuilder().async().intervalTicks(60L).execute(new ExpireTemporaryTask(this)).submit(this);