fix: destroy后仍有push流
This commit is contained in:
parent
30678d8ebf
commit
a35cda6873
@ -141,6 +141,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||||||
console.log('pipe error', error);
|
console.log('pipe error', error);
|
||||||
}
|
}
|
||||||
// close stream
|
// close stream
|
||||||
|
!stream.destroyed && stream.push(null);
|
||||||
stream.destroy();
|
stream.destroy();
|
||||||
|
|
||||||
const promptsLen = formatPrompts.reduce((sum, item) => sum + item.content.length, 0);
|
const promptsLen = formatPrompts.reduce((sum, item) => sum + item.content.length, 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user