mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
distinguishing between when DB is just connected and when it's ready for queries (validated)
This commit is contained in:
@@ -305,29 +305,31 @@ async function syncRequest(syncContext, method, uri, body) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isSyncSetup) {
|
||||
log.info("Setting up sync to " + SYNC_SERVER + " with timeout " + SYNC_TIMEOUT);
|
||||
sql.dbReady.then(() => {
|
||||
if (isSyncSetup) {
|
||||
log.info("Setting up sync to " + SYNC_SERVER + " with timeout " + SYNC_TIMEOUT);
|
||||
|
||||
if (SYNC_PROXY) {
|
||||
log.info("Sync proxy: " + SYNC_PROXY);
|
||||
if (SYNC_PROXY) {
|
||||
log.info("Sync proxy: " + SYNC_PROXY);
|
||||
}
|
||||
|
||||
const syncCertPath = config['Sync']['syncServerCertificate'];
|
||||
|
||||
if (syncCertPath) {
|
||||
log.info('Sync certificate: ' + syncCertPath);
|
||||
|
||||
syncServerCertificate = fs.readFileSync(syncCertPath);
|
||||
}
|
||||
|
||||
setInterval(sync, 60000);
|
||||
|
||||
// kickoff initial sync immediately
|
||||
setTimeout(sync, 1000);
|
||||
}
|
||||
|
||||
const syncCertPath = config['Sync']['syncServerCertificate'];
|
||||
|
||||
if (syncCertPath) {
|
||||
log.info('Sync certificate: ' + syncCertPath);
|
||||
|
||||
syncServerCertificate = fs.readFileSync(syncCertPath);
|
||||
else {
|
||||
log.info("Sync server not configured, sync timer not running.")
|
||||
}
|
||||
|
||||
setInterval(sync, 60000);
|
||||
|
||||
// kickoff initial sync immediately
|
||||
setTimeout(sync, 1000);
|
||||
}
|
||||
else {
|
||||
log.info("Sync server not configured, sync timer not running.")
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
sync,
|
||||
|
||||
Reference in New Issue
Block a user