lyhzzz 2 mesi fa
parent
commit
053185d7a9

+ 14 - 5
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -170,9 +170,12 @@ public class CaseDownService {
             log.info("down-offline-error:{}",caseId,e);
         }finally {
             try {
-                Thread.sleep(2000L);
-                FileUtil.del(zipName);
-                FileUtil.del(path+File.separator+name);
+                if(new File(zipName).exists()){
+                    new File(zipName).delete();
+                }
+                if(new File(path+File.separator+name).exists()){
+                    new File(path+File.separator+name).delete();
+                }
                 setRedisProcess(caseId,0,null,1003);
             }catch (Exception e){
                 log.info("down-offline-del-error:{}",caseId,e);
@@ -456,16 +459,22 @@ public class CaseDownService {
                }
                ShellUtil.yunDownload(uri.replace(queryPath, ""), kkzipPath);
                ShellUtil.unZip(kkzipPath,kknumPath);
-               FileUtil.del(kkzipPath);
+
            }else {
                //        {"msg":"操作成功","code":200,"data":{"status":1,"
                //        url":"https://laser-oss.4dkankan.com/testdata/SS-t-bY7NMQYlm6v/data/SS-t-bY7NMQYlm6v_offline18826401790
                ShellUtil.yunDownloadSs(uri.replace(ssQueryPath, ""), sszipPath);
                ShellUtil.unZip(sszipPath,ssNumPath);
-               FileUtil.del(sszipPath);
            }
        }catch (Exception e){
             log.info("下载场景离线包失败:{}",uri,e);
+       }finally {
+           if(kkzipPath != null && new File(kkzipPath).exists()){
+               new File(kkzipPath).delete();
+           }
+           if(sszipPath != null && new File(sszipPath).exists()){
+               new File(sszipPath).delete();
+           }
        }
 
    }