fix doc images (#1083)

* perf: clear tmp files

* fix doc images

* update docker-compose
This commit is contained in:
Archer
2024-03-28 10:17:28 +08:00
committed by GitHub
parent 00ace0b69c
commit 0490b83b9e
6 changed files with 45 additions and 4 deletions

View File

@@ -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, {

View File

@@ -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();
});
};