diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
commit | 2baea0c77cc765f7cbca9c9a2f4272268892a35c (patch) | |
tree | 47b1be5535439409a97eb80c0222c9c821b83dae /server/lib/schedulers/abstract-scheduler.ts | |
parent | bf079b7bfd7f0fb75ceb28e333bb4b74d8840dd4 (diff) | |
download | PeerTube-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.ts | 8 |
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 @@ | |||
1 | import { SCHEDULER_INTERVAL } from '../../initializers' | ||
2 | |||
3 | export abstract class AbstractScheduler { | 1 | export 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 () { |