mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 06:45:49 +01:00
distinguishing between when DB is just connected and when it's ready for queries (validated)
This commit is contained in:
@@ -8,7 +8,7 @@ const sync = require('./sync');
|
||||
let startTime = utils.nowTimestamp();
|
||||
let sentSyncId = [];
|
||||
|
||||
setInterval(async () => {
|
||||
async function sendPing() {
|
||||
const syncs = await sql.getResults("SELECT * FROM sync WHERE sync_date >= ? AND source_id != ?", [startTime, source_id.currentSourceId]);
|
||||
startTime = utils.nowTimestamp();
|
||||
|
||||
@@ -41,4 +41,6 @@ setInterval(async () => {
|
||||
for (const syncId of syncIds) {
|
||||
sentSyncId.push(syncId);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
sql.dbReady.then(() => setInterval(sendPing, 1000));
|
||||
Reference in New Issue
Block a user