修复定时任务/视图/环境变量更新逻辑

This commit is contained in:
whyour
2023-02-24 23:21:08 +08:00
parent 697bcb5922
commit e1e6261b4f
3 changed files with 12 additions and 8 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ import { TASK_PREFIX, QL_PREFIX } from '../config/const';
@Service()
export default class CronService {
constructor(@Inject('logger') private logger: winston.Logger) { }
constructor(@Inject('logger') private logger: winston.Logger) {}
private isSixCron(cron: Crontab) {
const { schedule } = cron;
@@ -41,8 +41,9 @@ export default class CronService {
}
public async update(payload: Crontab): Promise<Crontab> {
payload.saved = false;
const newDoc = await this.updateDb(payload);
const tab = new Crontab(payload);
tab.saved = false;
const newDoc = await this.updateDb(tab);
await this.set_crontab();
return newDoc;
}
@@ -452,7 +453,6 @@ export default class CronService {
} else {
return [];
}
}
private make_command(tab: Crontab) {