Skip to content

Commit 8bdd1c9

Browse files
committed
fix: export limit
1 parent fd8f0c8 commit 8bdd1c9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

client/src/pages/api/plugins/kb/data/exportModelData.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,15 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
4343
throw new Error(`上次导出未到 ${minutes},每 ${minutes}仅可导出一次。`);
4444
}
4545

46-
const where: any = [
47-
['kb_id', kbId],
48-
'AND',
49-
['user_id', userId],
50-
...(fileId
51-
? fileId === OtherFileId
52-
? ["AND (file_id IS NULL OR file_id = '')"]
53-
: ['AND', ['file_id', fileId]]
54-
: [])
55-
];
46+
const where: any = [['kb_id', kbId], 'AND', ['user_id', userId]];
5647
// 从 pg 中获取所有数据
5748
const pgData = await PgClient.select<{ q: string; a: string; source: string }>(
5849
PgTrainingTableName,
5950
{
6051
where,
6152
fields: ['q', 'a', 'source'],
62-
order: [{ field: 'id', mode: 'DESC' }]
53+
order: [{ field: 'id', mode: 'DESC' }],
54+
limit: 1000000
6355
}
6456
);
6557

@@ -88,7 +80,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
8880
export const config = {
8981
api: {
9082
bodyParser: {
91-
sizeLimit: '100mb'
83+
sizeLimit: '200mb'
9284
}
9385
}
9486
};

0 commit comments

Comments
 (0)