qinglong/back/data/cron.ts
2021-04-03 16:39:10 +08:00

28 lines
591 B
TypeScript

export class Crontab {
name?: string;
command: string;
schedule: string;
timestamp?: string;
created?: number;
saved?: boolean;
_id?: string;
status?: CrontabStatus;
constructor(options: Crontab) {
this.name = options.name;
this.command = options.command;
this.schedule = options.schedule;
this.saved = options.saved;
this._id = options._id;
this.created = options.created;
this.status = options.status || CrontabStatus.idle;
this.timestamp = new Date().toString();
}
}
export enum CrontabStatus {
'idle',
'running',
'disabled',
}