mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
增加日志删除频率设置
This commit is contained in:
@@ -54,8 +54,8 @@ export default class ScheduleService {
|
||||
);
|
||||
}
|
||||
|
||||
async cancelSchedule(id: string, jobName: string) {
|
||||
this.logger.info('[取消定时任务],任务名:%s', jobName);
|
||||
this.scheduleStacks.has(id) && this.scheduleStacks.get(id)?.cancel();
|
||||
async cancelSchedule({ _id = '', name }: Crontab) {
|
||||
this.logger.info('[取消定时任务],任务名:%s', name);
|
||||
this.scheduleStacks.has(_id) && this.scheduleStacks.get(_id)?.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,6 +374,7 @@ export default class UserService {
|
||||
command: `ql rmlog ${frequency}`,
|
||||
schedule: `5 23 */${frequency} * *`,
|
||||
};
|
||||
await this.scheduleService.cancelSchedule(cron);
|
||||
await this.scheduleService.generateSchedule(cron);
|
||||
return { code: 200, data: { ...cron } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user