Skip to content

Commit

Permalink
chron: 优化获取视频封面
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed May 3, 2024
1 parent 33fea45 commit b6bc698
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public String getVideoCover(String fileId, String username, String relativePath,
ProcessBuilder processBuilder = getVideoCoverProcessBuilder(videoPath, outputPath, videoDuration);
printSuccessInfo(processBuilder);
Process process = processBuilder.start();
boolean finished = process.waitFor(10, TimeUnit.SECONDS);
boolean finished = process.waitFor(5, TimeUnit.SECONDS);
try {
log.info("finished: {}", finished);
log.info("exitValue: {}", process.exitValue());
Expand All @@ -164,6 +164,7 @@ public String getVideoCover(String fileId, String username, String relativePath,
process.destroy(); // 尝试正常终止
process.destroyForcibly(); // 强制终止
log.error("进程超时并被终止。");
TimeUnit.SECONDS.sleep(2);
printErrorInfo(processBuilder);
} else {
// 进程结束但退出码非0
Expand Down

0 comments on commit b6bc698

Please sign in to comment.