1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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 () }