aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/abstract-scheduler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/schedulers/abstract-scheduler.ts')
-rw-r--r--server/lib/schedulers/abstract-scheduler.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/schedulers/abstract-scheduler.ts b/server/lib/schedulers/abstract-scheduler.ts
index 473544ddf..6ec5e3360 100644
--- a/server/lib/schedulers/abstract-scheduler.ts
+++ b/server/lib/schedulers/abstract-scheduler.ts
@@ -1,11 +1,13 @@
1import { SCHEDULER_INTERVAL } from '../../initializers'
2
3export abstract class AbstractScheduler { 1export abstract class AbstractScheduler {
4 2
3 protected abstract schedulerIntervalMs: number
4
5 private interval: NodeJS.Timer 5 private interval: NodeJS.Timer
6 6
7 enable () { 7 enable () {
8 this.interval = setInterval(() => this.execute(), SCHEDULER_INTERVAL) 8 if (!this.schedulerIntervalMs) throw new Error('Interval is not correctly set.')
9
10 this.interval = setInterval(() => this.execute(), this.schedulerIntervalMs)
9 } 11 }
10 12
11 disable () { 13 disable () {