Browse Source

bug-52693

dengsixing 1 month ago
parent
commit
7e36fe7f7c

+ 13 - 2
src/main/java/com/fdkankan/scene/controller/TestController.java

@@ -1,8 +1,11 @@
 package com.fdkankan.scene.controller;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.TimeInterval;
 import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @author dengsixing
  * @since 2022/8/17
  **/
+@Slf4j
 @RestController
 @RequestMapping("/test")
 public class TestController {
@@ -26,8 +30,15 @@ public class TestController {
     private FYunFileServiceInterface fYunFileService;
 
     @GetMapping("/test")
-    public ResultData test(){
-        return ResultData.ok(fYunFileService.fileExist("scene_result_data/KK-t-JCaoqtvy7AO/caches/images"));
+    public ResultData<Void> test(){
+        TimeInterval timer = DateUtil.timer();
+        fYunFileService.deleteFolder("test001/hotspot");
+        long l = timer.intervalRestart();
+        log.info("删除文件花费时间:{}", l);
+        fYunFileService.copyFileInBucketParallel("test/hotspot", "test001/hotspot");
+        long l2 = timer.intervalRestart();
+        log.info("删除文件花费时间:{}", l2);
+        return ResultData.ok();
     }
 
 }

+ 1 - 1
src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -298,7 +298,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         //复制编辑目录到发布目录
         String editPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum());
         String viewPath = String.format(UploadFilePath.USER_VIEW_PATH, param.getNum());
-        fYunFileService.copyFileBetweenBucket(bucket, editPath, bucket, viewPath);
+        fYunFileService.copyFileBetweenBucketParallel(bucket, editPath, bucket, viewPath);
 
         //sceneJson放入缓存
         String key = String.format(RedisKey.SCENE_JSON, num);