1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

poll new revision date instead of full sync each time

This commit is contained in:
Kyle Spearrin
2017-01-14 12:47:11 -05:00
parent c18cdd6206
commit bb56f9ee47
4 changed files with 63 additions and 13 deletions

View File

@@ -618,10 +618,11 @@ setInterval(fullSync, 5 * 60 * 1000); // check every 5 minutes
var syncInternal = 6 * 60 * 60 * 1000; // 6 hours
function fullSync(override) {
override = override || false;
syncService.getLastSync(function (lastSync) {
var now = new Date();
if (override || !lastSync || (now - lastSync) >= syncInternal) {
syncService.fullSync(function () { });
syncService.fullSync(override, function () { });
}
});
}