全新定时任务管理

This commit is contained in:
whyour
2021-04-03 16:39:10 +08:00
parent 32be5a6591
commit 8a45599919
9 changed files with 861 additions and 37 deletions
+27
View File
@@ -0,0 +1,27 @@
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',
}