chore(prettier): fix all files

This commit is contained in:
Elian Doran
2025-01-09 18:07:02 +02:00
parent 19ee861699
commit 4cbb529fd4
571 changed files with 23226 additions and 23940 deletions

View File

@@ -10,7 +10,7 @@ import BNote from "../becca/entities/bnote.js";
function getRunAtHours(note: BNote): number[] {
try {
return note.getLabelValues('runAtHour').map(hour => parseInt(hour));
return note.getLabelValues("runAtHour").map((hour) => parseInt(hour));
} catch (e: any) {
log.error(`Could not parse runAtHour for note ${note.noteId}: ${e.message}`);
@@ -21,15 +21,13 @@ function getRunAtHours(note: BNote): number[] {
function runNotesWithLabel(runAttrValue: string) {
const instanceName = config.General ? config.General.instanceName : null;
const currentHours = new Date().getHours();
const notes = attributeService.getNotesWithLabel('run', runAttrValue);
const notes = attributeService.getNotesWithLabel("run", runAttrValue);
for (const note of notes) {
const runOnInstances = note.getLabelValues('runOnInstance');
const runOnInstances = note.getLabelValues("runOnInstance");
const runAtHours = getRunAtHours(note);
if ((runOnInstances.length === 0 || runOnInstances.includes(instanceName))
&& (runAtHours.length === 0 || runAtHours.includes(currentHours))
) {
if ((runOnInstances.length === 0 || runOnInstances.includes(instanceName)) && (runAtHours.length === 0 || runAtHours.includes(currentHours))) {
scriptService.executeNoteNoException(note, { originEntity: note });
}
}
@@ -41,13 +39,25 @@ sqlInit.dbReady.then(() => {
});
if (!process.env.TRILIUM_SAFE_MODE) {
setTimeout(cls.wrap(() => runNotesWithLabel('backendStartup')), 10 * 1000);
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
);
setInterval(cls.wrap(() => hiddenSubtreeService.checkHiddenSubtree()), 7 * 3600 * 1000);
setInterval(
cls.wrap(() => hiddenSubtreeService.checkHiddenSubtree()),
7 * 3600 * 1000
);
}
setInterval(() => protectedSessionService.checkProtectedSessionExpiration(), 30000);