From 4c605cdd219fa07c78b8064253b39702f64df299 Mon Sep 17 00:00:00 2001 From: lrh <1585126058@qq.com> Date: Wed, 5 Jul 2023 10:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E9=80=BB=E8=BE=91=E3=80=81=E6=96=B0=E5=A2=9E=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=A3=80=E6=9F=A5=E6=8E=A5=E5=8F=A3=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=99=BE=E5=BA=A6API=E6=8E=A5=E5=8F=A3=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E9=98=BF=E9=87=8C=E4=BA=91?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E3=80=81=E6=96=B0=E5=A2=9E=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/sm/impl/PhotoSpeakVideoServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java index 9488361..0de0f5b 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java @@ -273,6 +273,9 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { break; } if (integer.getAndDecrement() <= 0){ + mouldVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); + mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); + this.updateById(mouldVideo); break; } } @@ -358,12 +361,21 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { AtomicInteger integer = new AtomicInteger(30); while (true){ String progress = videoFactory.getExcutor(videoType).getVedioUploadProgress(result.getVideoId()); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + if (progress.equals("complete")) { mouldVideo.setVideoHyStatus(EnumVideoStatus.upload_success.getCode()); this.updateById(mouldVideo); break; } if (integer.getAndDecrement() <= 0){ + mouldVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); + mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); + this.updateById(mouldVideo); break; } }