Commit 8a50a02d27d6305d46c7902b0e17d491520f49f6
1 parent
7de9f1e1
优化文件删除逻辑
Showing
2 changed files
with
2 additions
and
1 deletions
src/main/java/top/panll/assist/service/FileManagerTimer.java
| ... | ... | @@ -81,7 +81,7 @@ public class FileManagerTimer { |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - if (streamFile.listFiles() == null && streamFile.listFiles().length == 0) { | |
| 84 | + if (streamFile.listFiles() == null || streamFile.listFiles().length == 0) { | |
| 85 | 85 | boolean result = FileUtils.deleteQuietly(streamFile); |
| 86 | 86 | if (result) { |
| 87 | 87 | logger.info("[录像巡查]成功移除 {} ", streamFile.getAbsolutePath()); | ... | ... |
src/main/java/top/panll/assist/service/VideoFileService.java