Run the save every minute, instead of every 10 seconds.
Next up: making mysql async.
This commit is contained in:
parent
b6ffb8a272
commit
f2cf051b4e
@ -42,6 +42,15 @@ public class JailTimer {
|
|||||||
|
|
||||||
timer.start();
|
timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Save all the jail information every minute, not every 10 seconds
|
||||||
|
pl.getServer().getScheduler().runTaskTimerAsynchronously(pl, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
for(Jail j : pl.getJailManager().getJails()) {
|
||||||
|
pl.getJailIO().saveJail(j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1200L, 1200L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the instance of this timer. */
|
/** Returns the instance of this timer. */
|
||||||
@ -103,9 +112,6 @@ public class JailTimer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save all the prisoners and jails after we're done
|
|
||||||
pl.getJailIO().saveJail(j);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user