mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 05:19:51 +00:00
v4.6.9-alpha (#918)
Co-authored-by: Mufei <327958099@qq.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
import { initSystemConfig } from '@/pages/api/common/system/getInitData';
|
||||
import { startQueue } from '@/service/utils/tools';
|
||||
import { setCron } from '@fastgpt/service/common/system/cron';
|
||||
import { startTrainingQueue } from '@/service/core/dataset/training/utils';
|
||||
|
||||
export const startCron = () => {
|
||||
setUpdateSystemConfigCron();
|
||||
setTrainingQueueCron();
|
||||
};
|
||||
|
||||
export const setUpdateSystemConfigCron = () => {
|
||||
setCron('*/5 * * * *', () => {
|
||||
initSystemConfig();
|
||||
console.log('refresh system config');
|
||||
});
|
||||
};
|
||||
|
||||
export const setTrainingQueueCron = () => {
|
||||
setCron('*/1 * * * *', () => {
|
||||
startQueue();
|
||||
startTrainingQueue();
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user