From 9ad9ffabf79cb85670428330b40170c3735989a2 Mon Sep 17 00:00:00 2001 From: baldo Date: Mon, 22 Feb 2021 21:48:39 +0100 Subject: [PATCH] Fix: Background-Jobs did not run automatically. * Had to make sure `this` referred to `task` in `task.run()`. --- server/jobs/scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/jobs/scheduler.ts b/server/jobs/scheduler.ts index 1ebe7e1..a66c0a1 100644 --- a/server/jobs/scheduler.ts +++ b/server/jobs/scheduler.ts @@ -122,7 +122,7 @@ function schedule(expr: string, job: Job): void { true, ); - cron.schedule(expr, task.run); + cron.schedule(expr, () => task.run()); tasks['' + id] = task; }