script can wait until the sync data has been applied

This commit is contained in:
zadam
2019-10-20 17:49:58 +02:00
parent 358fd13c8d
commit 2a5ab3a5e1
6 changed files with 95 additions and 23 deletions

View File

@@ -327,6 +327,10 @@ async function updatePushStats() {
}
}
async function getMaxSyncId() {
return await sql.getValue('SELECT MAX(id) FROM sync');
}
sqlInit.dbReady.then(async () => {
setInterval(cls.wrap(sync), 60000);
@@ -340,5 +344,6 @@ module.exports = {
sync,
login,
getSyncRecords,
stats
stats,
getMaxSyncId
};