electron fixes

This commit is contained in:
azivner
2018-04-05 23:17:19 -04:00
parent 98f80998b9
commit e827ddffb9
7 changed files with 37 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
const scriptService = require('./script');
const repository = require('./repository');
const cls = require('./cls');
const sqlInit = require('./sql_init');
async function runNotesWithLabel(runAttrValue) {
const notes = await repository.getEntities(`
@@ -19,8 +20,10 @@ async function runNotesWithLabel(runAttrValue) {
}
}
setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);
sqlInit.dbReady.then(() => {
setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('hourly')), 3600 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('hourly')), 3600 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('daily')), 24 * 3600 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('daily')), 24 * 3600 * 1000);
});