Explorar el Código

saveboxvideo接口打印耗时日志

dengsixing hace 3 años
padre
commit
a0be9e4c17

+ 7 - 2
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -2599,14 +2599,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         }
 
         //从用户编辑目录中下载视频到本地
-        if (!StorageType.LOCAL.code().equals(this.type)) {
+        long start = Calendar.getInstance().getTimeInMillis();
+//        if (!StorageType.LOCAL.code().equals(this.type)) {
             String filePath = userEditPath + fileName;
             String imageUrl = ossUrlPrefix + filePath + "?t=" + System.currentTimeMillis();
             FileUtils.downLoadFromUrl(imageUrl, fileName, localImagesPath);
-        }
+//        }
+        long end1 = Calendar.getInstance().getTimeInMillis();
+        log.info("下载耗时:{},url:{}", end1 - start, ossUrlPrefix + filePath + "?t=" + System.currentTimeMillis());
 
         //视频格式转换
         CreateObjUtil.mp4ToFlv(localFilePath, localFilePath.replace("mp4", "flv"));
+        long end2 = Calendar.getInstance().getTimeInMillis();
+        log.info("视频转换耗时:{}", end2 - end1);
 
         //上传
         String flvFileName = fileName.replace("mp4", "flv");