🔧 Prevent metadata.json update if the sync time value is the same (#3398)

* prevent metadata.json update if the sync time value is the same as the saved one

* release notes
This commit is contained in:
Michael Clark
2024-09-08 20:28:53 +01:00
committed by GitHub
parent cb0411b180
commit 21dc573f3f
2 changed files with 15 additions and 5 deletions

View File

@@ -768,11 +768,15 @@ async function _fullSync(
),
);
} else {
// All synced up, store the current time as a simple optimization
// for the next sync
await prefs.savePrefs({
lastSyncedTimestamp: getClock().timestamp.toString(),
});
// All synced up, store the current time as a simple optimization for the next sync
const requiresUpdate =
getClock().timestamp.toString() !== lastSyncedTimestamp;
if (requiresUpdate) {
await prefs.savePrefs({
lastSyncedTimestamp: getClock().timestamp.toString(),
});
}
}
return receivedMessages;

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MikesGlitch]
---
Prevent sync from saving to metadata.json unnecessarily