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) => {
|
nodeReadableStream.on("error", (err) => {
|
||||||
console.error(err);
|
console.error("readalbe stream error",err);
|
||||||
releaseZip(path);
|
setTimeout(()=>{
|
||||||
|
releaseZip(path)
|
||||||
|
},100);
|
||||||
});
|
});
|
||||||
nodeReadableStream.on("close", () => {
|
nodeReadableStream.on("close", () => {
|
||||||
|
setTimeout(()=>{
|
||||||
releaseZip(path);
|
releaseZip(path);
|
||||||
|
},100);
|
||||||
});
|
});
|
||||||
|
|
||||||
ctx.body = nodeReadableStream;
|
ctx.body = nodeReadableStream;
|
||||||
|
Loading…
Reference in New Issue
Block a user