mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
全新定时任务管理
This commit is contained in:
@@ -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',
|
||||
}
|
||||
Reference in New Issue
Block a user