Skip to content

Commit

Permalink
fix: export limit
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Sep 10, 2023
1 parent fd8f0c8 commit 8bdd1c9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions client/src/pages/api/plugins/kb/data/exportModelData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,15 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
throw new Error(`上次导出未到 ${minutes},每 ${minutes}仅可导出一次。`);
}

const where: any = [
['kb_id', kbId],
'AND',
['user_id', userId],
...(fileId
? fileId === OtherFileId
? ["AND (file_id IS NULL OR file_id = '')"]
: ['AND', ['file_id', fileId]]
: [])
];
const where: any = [['kb_id', kbId], 'AND', ['user_id', userId]];
// 从 pg 中获取所有数据
const pgData = await PgClient.select<{ q: string; a: string; source: string }>(
PgTrainingTableName,
{
where,
fields: ['q', 'a', 'source'],
order: [{ field: 'id', mode: 'DESC' }]
order: [{ field: 'id', mode: 'DESC' }],
limit: 1000000
}
);

Expand Down Expand Up @@ -88,7 +80,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
export const config = {
api: {
bodyParser: {
sizeLimit: '100mb'
sizeLimit: '200mb'
}
}
};

0 comments on commit 8bdd1c9

Please sign in to comment.