sync status widget

This commit is contained in:
zadam
2021-03-21 22:43:41 +01:00
parent 1a9919a866
commit 392a00ac17
9 changed files with 156 additions and 112 deletions

View File

@@ -363,10 +363,16 @@ function setLastSyncedPull(entityChangeId) {
}
function getLastSyncedPush() {
return parseInt(optionService.getOption('lastSyncedPush'));
const lastSyncedPush = parseInt(optionService.getOption('lastSyncedPush'));
ws.setLastSyncedPush(lastSyncedPush);
return lastSyncedPush;
}
function setLastSyncedPush(entityChangeId) {
ws.setLastSyncedPush(entityChangeId);
optionService.setOption('lastSyncedPush', entityChangeId);
}
@@ -382,9 +388,12 @@ sqlInit.dbReady.then(() => {
setInterval(cls.wrap(sync), 60000);
// kickoff initial sync immediately
setTimeout(cls.wrap(sync), 3000);
setTimeout(cls.wrap(sync), 5000);
});
// called just so ws.setLastSyncedPush() is called
getLastSyncedPush();
module.exports = {
sync,
login,