added "safe mode" environment variable switch which disables startup scripts and resets tabs

This commit is contained in:
zadam
2021-01-15 20:12:14 +01:00
parent e06c5703ee
commit e1e185e5db
5 changed files with 22 additions and 8 deletions

View File

@@ -22,9 +22,11 @@ function runNotesWithLabel(runAttrValue) {
}
sqlInit.dbReady.then(() => {
setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);
if (!process.env.TRILIUM_SAFE_MODE) {
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);
}
});