From b6bc69832c3278ea93b28f92dbf25ac6c3cd354c Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 3 May 2024 17:34:29 +0800 Subject: [PATCH] =?UTF-8?q?chron:=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=B0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jmal/clouddisk/service/video/VideoProcessService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jmal/clouddisk/service/video/VideoProcessService.java b/src/main/java/com/jmal/clouddisk/service/video/VideoProcessService.java index 04e1b4de..0e03fbe4 100644 --- a/src/main/java/com/jmal/clouddisk/service/video/VideoProcessService.java +++ b/src/main/java/com/jmal/clouddisk/service/video/VideoProcessService.java @@ -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()); @@ -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