异常处理
This commit is contained in:
parent
054ab25205
commit
04cfcfd22a
@ -270,11 +270,17 @@ public class VideoService {
|
||||
|
||||
if(ffmpegConfig.getUseTmpFile()) {
|
||||
ServletOutputStream servletOutputStream = response.getOutputStream();
|
||||
IoUtil.copy(new FileInputStream(file), servletOutputStream);
|
||||
response.flushBuffer();
|
||||
System.gc();
|
||||
boolean delete = file.delete();
|
||||
log.info("删除临时文件 {} => {}", file, delete);
|
||||
try{
|
||||
log.info("临时文件 {}(大小 {})", file.getAbsolutePath(), file.length());
|
||||
IoUtil.copy(new FileInputStream(file), servletOutputStream);
|
||||
response.flushBuffer();
|
||||
} catch (Exception e){
|
||||
log.error("写入 http 响应异常: {}", e.getMessage());
|
||||
} finally {
|
||||
System.gc();
|
||||
boolean delete = file.delete();
|
||||
log.info("删除临时文件 {} => {}", file, delete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user