Skip to content

Commit

Permalink
update remoteLastChangedDate during pulldatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Jan 6, 2024
1 parent d30595b commit 2835d05
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ private void pullDatabase(DatabaseMetadata metadata) {
return;
}

DocFileMetadata remote = getRemoteMetadata(uri);
metadata.remoteLastChangedDate = remote.lastModified.toIsoString();

// Store the local snapshot timestamp, the time when the file was downloaded.
MmxDate localSnapshot = getLocalFileModifiedDate(metadata);
metadata.localSnapshotTimestamp = localSnapshot.toIsoString();
Expand Down Expand Up @@ -375,7 +378,7 @@ private void downloadDatabase(Uri uri, String localPath) throws Exception {

// Replace local database with downloaded version
File localDatabaseFile = new File(localPath);
Timber.i("%s %s %s", tempDatabaseFile.toPath(), localDatabaseFile.toPath(), localPath);
Timber.d("%s %s %s", tempDatabaseFile.toPath(), localDatabaseFile.toPath(), localPath);
// StandardCopyOption.REPLACE_EXISTING ensures that the destination file is replaced if it exists
Files.move(tempDatabaseFile, localDatabaseFile);
}
Expand Down

0 comments on commit 2835d05

Please sign in to comment.