Retry backup verify and rename with delay.

This commit is contained in:
Cody Henthorne
2022-08-23 16:21:10 -04:00
committed by Greyson Parrelli
parent 7a7c4c28c2
commit 05c16e4c70
2 changed files with 49 additions and 8 deletions

View File

@@ -413,7 +413,7 @@ public class FullBackupExporter extends FullBackupBase {
return count;
}
private static long calculateVeryOldStreamLength(@NonNull AttachmentSecret attachmentSecret, @Nullable byte[] random, @NonNull String data) throws IOException {
private static long calculateVeryOldStreamLength(@NonNull AttachmentSecret attachmentSecret, @Nullable byte[] random, @NonNull String data) {
long result = 0;
try (InputStream inputStream = openAttachmentStream(attachmentSecret, random, data)) {
@@ -425,6 +425,10 @@ public class FullBackupExporter extends FullBackupBase {
}
} catch (FileNotFoundException e) {
Log.w(TAG, "Missing attachment: " + e.getMessage());
return 0;
} catch (IOException e) {
Log.w(TAG, "Failed to determine stream length", e);
return 0;
}
return result;
@@ -708,6 +712,7 @@ public class FullBackupExporter extends FullBackupBase {
public void close() throws IOException {
outputStream.flush();
outputStream.close();
}
}