mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 05:19:51 +00:00
4.6.7 first pr (#726)
This commit is contained in:
18
projects/app/src/service/common/system/cron.ts
Normal file
18
projects/app/src/service/common/system/cron.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { initSystemConfig } from '@/pages/api/common/system/getInitData';
|
||||
import { generateQA } from '@/service/events/generateQA';
|
||||
import { generateVector } from '@/service/events/generateVector';
|
||||
import { setCron } from '@fastgpt/service/common/system/cron';
|
||||
|
||||
export const setUpdateSystemConfigCron = () => {
|
||||
setCron('*/5 * * * *', () => {
|
||||
initSystemConfig();
|
||||
console.log('refresh system config');
|
||||
});
|
||||
};
|
||||
|
||||
export const setTrainingQueueCron = () => {
|
||||
setCron('*/3 * * * *', () => {
|
||||
generateVector();
|
||||
generateQA();
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user