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

@@ -1,5 +1,6 @@
const script = require('./script');
const Repository = require('./repository');
const cls = require('./cls');
const repo = new Repository();
@@ -20,8 +21,8 @@ async function runNotesWithLabel(runAttrValue) {
}
}
setTimeout(() => runNotesWithLabel('backend_startup'), 10 * 1000);
setTimeout(cls.wrap(() => runNotesWithLabel('backend_startup')), 10 * 1000);
setInterval(() => runNotesWithLabel('hourly'), 3600 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('hourly')), 3600 * 1000);
setInterval(() => runNotesWithLabel('daily'), 24 * 3600 * 1000);
setInterval(cls.wrap(() => runNotesWithLabel('daily'), 24 * 3600 * 1000));