added basic CLS support with re-entrant transactions

This commit is contained in:
azivner
2018-03-28 23:41:22 -04:00
parent b10b0048f3
commit 0ec909fd7a
13 changed files with 115 additions and 24 deletions

View File

@@ -15,6 +15,7 @@ const app_info = require('./app_info');
const messaging = require('./messaging');
const sync_setup = require('./sync_setup');
const sync_mutex = require('./sync_mutex');
const cls = require('./cls');
let proxyToggle = true;
let syncServerCertificate = null;
@@ -347,10 +348,10 @@ sql.dbReady.then(() => {
syncServerCertificate = fs.readFileSync(sync_setup.SYNC_CERT_PATH);
}
setInterval(sync, 60000);
setInterval(cls.wrap(sync), 60000);
// kickoff initial sync immediately
setTimeout(sync, 1000);
setTimeout(cls.wrap(sync), 1000);
}
else {
log.info("Sync server not configured, sync timer not running.")