import { ISchedulerJobHandler } from './types' ; import { Job , cancelJob } from 'node-schedule' ; export class BasicJobHandler implements ISchedulerJobHandler { private job : Job ; constructor ( job ) { this . job = job ; } cancel ( ) { this . job . cancel ( ) ; cancelJob ( this . job ) ; } reschedule ( time ) { this . job . reschedule ( time ) ; } nextScheduleTime ( ) { return this . job . nextInvocation ( ) ; } }