Skip to content

Commit

Permalink
fix wait for restore finished before ExtrasUtil.checkCreateMeta
Browse files Browse the repository at this point in the history
  • Loading branch information
mg4gh committed Jan 26, 2025
1 parent a413a45 commit a2a4fe8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ public void onActivityResumed(@NonNull Activity activity) {
}

public void checkCreateLoadMetaData(boolean onlyNew){
File restoreJob = new File(persistenceManager.getRestoreDir(), "restore.job");
while (restoreJob.exists()){ // don't start as restore may add files
File backupLatest = new File(persistenceManager.getRestoreDir(), BackupUtil.getBackupFileName(true));
File backupFull = new File(persistenceManager.getRestoreDir(), BackupUtil.getBackupFileName(false));
while (backupLatest.exists() || backupFull.exists()){ // don't start as restore may add files
SystemClock.sleep(1000);
}
ArrayList<String> newNames = ExtrasUtil.checkCreateMeta(this, this.currentRun);
Expand Down
2 changes: 1 addition & 1 deletion mgmap/src/main/java/mg/mgmap/generic/util/BackupUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BackupUtil {

private static final AtomicBoolean inProgress = new AtomicBoolean(false);

private static String getBackupFileName(boolean latest){
public static String getBackupFileName(boolean latest){
return "backup_"+(latest?"latest":"full")+".zip";
}

Expand Down

0 comments on commit a2a4fe8

Please sign in to comment.