Browse Source

v3场景下载

dengsixing 2 years ago
parent
commit
9c70e89810

+ 3 - 10
src/main/java/com/fdkankan/download/service/impl/SceneDownloadHandlerServiceImpl.java

@@ -206,6 +206,7 @@ public class SceneDownloadHandlerServiceImpl {
         ZipOutputStream out = null;
 
         try {
+            TimeInterval timer = DateUtil.timer();
 
             ScenePlus scenePlus = scenePlusService.getByNum(num);
             if(Objects.isNull(scenePlus))
@@ -249,18 +250,13 @@ public class SceneDownloadHandlerServiceImpl {
                 imagesVersion = version;
             }
 
-
-            long start = Calendar.getInstance().getTimeInMillis();
-
             //固定文件写入
             this.zipLocalFiles(out, v4localFilePaths, v4localPath, num, count, total, "v4");
-            long end1 = Calendar.getInstance().getTimeInMillis();
-            log.info("打包固定文件耗时, num:{}, time:{}", num, end1 - start);
+            log.info("打包固定文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //oss文件写入
             this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v4");
-            long end2 = Calendar.getInstance().getTimeInMillis();
-            log.info("打包oss文件耗时, num:{}, time:{}", num, end2 - end1);
+            log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //重新写入scene.json(去掉密码访问设置)
             this.zipSceneJson(out, this.wwwroot, num, sceneJson);
@@ -278,7 +274,6 @@ public class SceneDownloadHandlerServiceImpl {
             String url = this.publicUrl + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
             this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v4");
 
-
         }catch (Exception e){
             //更新进度为下载失败
             this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v4");
@@ -340,7 +335,6 @@ public class SceneDownloadHandlerServiceImpl {
 
             //oss文件写入
             this.zipOssFiles(out, ossFilePaths, num, count, total, resolution, imagesVersion, cacheKeys, "v3");
-            long end2 = Calendar.getInstance().getTimeInMillis();
             log.info("打包oss文件耗时, num:{}, time:{}", num, timer.intervalRestart());
 
             //重新写入scene.json(去掉密码访问设置)
@@ -359,7 +353,6 @@ public class SceneDownloadHandlerServiceImpl {
             String url = this.publicUrl + uploadPath + "?t=" + Calendar.getInstance().getTimeInMillis();
             this.updateProgress(null, num, SceneDownloadProgressStatus.DOWNLOAD_SUCCESS.code(), url, "v3");
 
-
         }catch (Exception e){
             //更新进度为下载失败
             this.updateProgress( null, num, SceneDownloadProgressStatus.DOWNLOAD_FAILED.code(), null, "v3");