1
0
Fork 0
peertube/server/lib/schedulers/abstract-scheduler.ts

17 lines
314 B
TypeScript
Raw Normal View History

import { SCHEDULER_INTERVAL } from '../../initializers'
export abstract class AbstractScheduler {
private interval: NodeJS.Timer
enable () {
this.interval = setInterval(() => this.execute(), SCHEDULER_INTERVAL)
}
disable () {
clearInterval(this.interval)
}
protected abstract execute ()
}