mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix doc images (#1083)
* perf: clear tmp files * fix doc images * update docker-compose
This commit is contained in:
@@ -27,7 +27,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
throw new Error('bucketName is empty');
|
||||
}
|
||||
|
||||
const upLoadResults = await uploadFile({
|
||||
const fileId = await uploadFile({
|
||||
teamId,
|
||||
tmbId,
|
||||
bucketName,
|
||||
@@ -38,7 +38,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
});
|
||||
|
||||
jsonRes(res, {
|
||||
data: upLoadResults
|
||||
data: fileId
|
||||
});
|
||||
} catch (error) {
|
||||
jsonRes(res, {
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import { setCron } from '@fastgpt/service/common/system/cron';
|
||||
import { startTrainingQueue } from '@/service/core/dataset/training/utils';
|
||||
import { clearTmpUploadFiles } from '@fastgpt/service/common/file/utils';
|
||||
|
||||
export const startCron = () => {
|
||||
setTrainingQueueCron();
|
||||
setClearTmpUploadFilesCron();
|
||||
};
|
||||
|
||||
export const setTrainingQueueCron = () => {
|
||||
@@ -10,3 +12,11 @@ export const setTrainingQueueCron = () => {
|
||||
startTrainingQueue();
|
||||
});
|
||||
};
|
||||
|
||||
export const setClearTmpUploadFilesCron = () => {
|
||||
clearTmpUploadFiles();
|
||||
// Clear tmp upload files every ten minutes
|
||||
setCron('*/10 * * * *', () => {
|
||||
clearTmpUploadFiles();
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user