Rework #6
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		
		Reference in a new issue