Skip to content

Commit

Permalink
Merge pull request #2053 from moneymanagerex/saf
Browse files Browse the repository at this point in the history
Sync: resolver.notifyChange to prompt synchronization.
  • Loading branch information
guanlisheng authored Jan 3, 2025
2 parents 1ce1ede + 8884f80 commit ebb864f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ private void uploadDatabase(DatabaseMetadata metadata) {
// Use Files.copy() for direct file-to-stream copy
try (OutputStream outputStream = new FileOutputStream(pfd.getFileDescriptor())) {
Files.copy(localFile.toPath(), outputStream);
// Notify resolver to ensure synchronization
resolver.notifyChange(remoteUri, null);
Timber.d("Database stored successfully to %s", remoteUri);
}
} catch (FileNotFoundException e) {
Timber.e(e, "File not found during upload: %s", metadata.localPath);
Timber.e(e, "File not found during upload: %s, URI: %s", metadata.localPath, remoteUri);
} catch (IOException e) {
Timber.e(e, "IO error during upload: %s", metadata.localPath);
}
Expand Down

0 comments on commit ebb864f

Please sign in to comment.