fix: export limit
This commit is contained in:
@@ -43,23 +43,15 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
throw new Error(`上次导出未到 ${minutes},每 ${minutes}仅可导出一次。`);
|
throw new Error(`上次导出未到 ${minutes},每 ${minutes}仅可导出一次。`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const where: any = [
|
const where: any = [['kb_id', kbId], 'AND', ['user_id', userId]];
|
||||||
['kb_id', kbId],
|
|
||||||
'AND',
|
|
||||||
['user_id', userId],
|
|
||||||
...(fileId
|
|
||||||
? fileId === OtherFileId
|
|
||||||
? ["AND (file_id IS NULL OR file_id = '')"]
|
|
||||||
: ['AND', ['file_id', fileId]]
|
|
||||||
: [])
|
|
||||||
];
|
|
||||||
// 从 pg 中获取所有数据
|
// 从 pg 中获取所有数据
|
||||||
const pgData = await PgClient.select<{ q: string; a: string; source: string }>(
|
const pgData = await PgClient.select<{ q: string; a: string; source: string }>(
|
||||||
PgTrainingTableName,
|
PgTrainingTableName,
|
||||||
{
|
{
|
||||||
where,
|
where,
|
||||||
fields: ['q', 'a', 'source'],
|
fields: ['q', 'a', 'source'],
|
||||||
order: [{ field: 'id', mode: 'DESC' }]
|
order: [{ field: 'id', mode: 'DESC' }],
|
||||||
|
limit: 1000000
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -88,7 +80,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
export const config = {
|
export const config = {
|
||||||
api: {
|
api: {
|
||||||
bodyParser: {
|
bodyParser: {
|
||||||
sizeLimit: '100mb'
|
sizeLimit: '200mb'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user