From b2ee22eb7ba895ca6e13bc30a21d793acfbab3bd Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 27 Sep 2021 23:23:06 +0200 Subject: [PATCH] Disable synchronous behavior to prevent odd behavior when the backup button is spam clicked --- .../knarcraft/minecraftserverlauncher/utility/BackupUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java index 1a752af..258cbae 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/BackupUtil.java @@ -43,7 +43,7 @@ public class BackupUtil { * @param alreadyCopied

The amount of bytes already copied

* @throws IOException

If we can't start a file stream

*/ - private static synchronized long backupFolder(File source, File destination, long backupFileSize, + private static long backupFolder(File source, File destination, long backupFileSize, long alreadyCopied) throws IOException { if (backupAborted) { return 0L; @@ -98,7 +98,7 @@ public class BackupUtil { * * @param gui

The GUI to use for informing the user

*/ - public synchronized static void backup(GUI gui) { + public static void backup(GUI gui) { backupAborted = false; if (backupRunning) { gui.setStatus("A backup is already running");