fix: close before streaming
This commit is contained in:
parent
76d1c6b33d
commit
0f233183ac
@ -94,11 +94,15 @@ async function renderZipImage(ctx: Context, path: string, page: number) {
|
||||
},
|
||||
}));
|
||||
nodeReadableStream.on("error", (err) => {
|
||||
console.error(err);
|
||||
releaseZip(path);
|
||||
console.error("readalbe stream error",err);
|
||||
setTimeout(()=>{
|
||||
releaseZip(path)
|
||||
},100);
|
||||
});
|
||||
nodeReadableStream.on("close", () => {
|
||||
setTimeout(()=>{
|
||||
releaseZip(path);
|
||||
},100);
|
||||
});
|
||||
|
||||
ctx.body = nodeReadableStream;
|
||||
|
Loading…
Reference in New Issue
Block a user