aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/schedulers/abstract-scheduler.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-14 18:06:56 +0200
committerChocobozzz <me@florianbigard.com>2018-06-14 18:06:56 +0200
commit2baea0c77cc765f7cbca9c9a2f4272268892a35c (patch)
tree47b1be5535439409a97eb80c0222c9c821b83dae /server/lib/schedulers/abstract-scheduler.ts
parentbf079b7bfd7f0fb75ceb28e333bb4b74d8840dd4 (diff)
downloadPeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.gz
PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.zst
PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.zip
Add ability for uploaders to schedule video update
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 () {