try something like 1 sexond?

This commit is contained in:
Chayapak 2023-07-05 19:18:46 +07:00
parent 34f9989d11
commit fbcde87ef0

View file

@ -48,7 +48,7 @@ public class PersistentDataUtilities {
write(queue.get(0)); write(queue.get(0));
queue.remove(0); queue.remove(0);
}, 0, 50, TimeUnit.MILLISECONDS); }, 0, 1, TimeUnit.SECONDS);
Runtime.getRuntime().addShutdownHook(new Thread(() -> { Runtime.getRuntime().addShutdownHook(new Thread(() -> {
while (true) { while (true) {
@ -60,7 +60,7 @@ public class PersistentDataUtilities {
} }
} }
private static void write (String object) { private static synchronized void write (String object) {
try { try {
writer.close(); writer.close();