Add a method in BackupManager to check if a backup is currently running.

This commit is contained in:
Marc Baloup 2023-07-14 19:07:02 +02:00
parent d7bb56e0b2
commit 5fb17be4c7
1 changed files with 4 additions and 1 deletions

View File

@ -67,6 +67,9 @@ public class BackupManager extends TimerTask {
}
public synchronized boolean isBackupRunning() {
return runningBackup.get() != null;
}
public synchronized void run() {
@ -94,7 +97,7 @@ public class BackupManager extends TimerTask {
schedulerTimer.cancel();
if (runningBackup.get() != null) {
if (isBackupRunning()) {
Log.warning("[Backup] Waiting after the end of a backup...");
BackupProcess tmp;
while ((tmp = runningBackup.get()) != null) {