修复openapi认证,环境变量排序

This commit is contained in:
whyour
2022-01-13 11:13:04 +08:00
parent e13ff86ff6
commit 43bc29b25c
4 changed files with 21 additions and 8 deletions
+6
View File
@@ -31,6 +31,12 @@ export default class CronService {
}
public async insert(payload: Crontab): Promise<Crontab> {
const cron = await CrontabModel.findOne({
where: { command: payload.command },
});
if (cron) {
return cron;
}
return await CrontabModel.create(payload, { returning: true });
}