|
@@ -207,6 +207,14 @@ public class RabbitMqListener {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+
|
|
|
+ // 检测计算结果文件是否有生成
|
|
|
+ String resultsPath = path + File.separator + "results" + File.separator;
|
|
|
+ if (!new File(resultsPath + "upload.json").exists()) {
|
|
|
+ log.error("未检测到计算结果文件:upload.json");
|
|
|
+ return ModelingBuildStatus.FAILED;
|
|
|
+ }
|
|
|
+
|
|
|
return ModelingBuildStatus.SUCCESS;
|
|
|
}
|
|
|
|
|
@@ -225,8 +233,13 @@ public class RabbitMqListener {
|
|
|
//计算模型并返回需要上传oss的文件集合
|
|
|
ComputerUtil.computer(num, path, buildType);
|
|
|
|
|
|
+ // 检测计算结果文件是否有生成
|
|
|
+ String resultsPath = path + File.separator + "results" + File.separator;
|
|
|
+ if (!new File(resultsPath + "upload.json").exists()) {
|
|
|
+ log.error("未检测到计算结果文件:upload.json");
|
|
|
+ return ModelingBuildStatus.FAILED;
|
|
|
+ }
|
|
|
log.info("八目上完oss结束修改数据:"+num);
|
|
|
-
|
|
|
return ModelingBuildStatus.SUCCESS;
|
|
|
}
|
|
|
|
|
@@ -311,15 +324,7 @@ public class RabbitMqListener {
|
|
|
//判断是否计算过资源,若计算过删除缓存, 如果caches中存在_images文件或者目录,就删除掉,否则就删除除了images以外的所有文件和目录
|
|
|
File caches = new File(path + File.separator + "caches");
|
|
|
if (caches.exists()) {
|
|
|
- for (File deleteFile : caches.listFiles()) {
|
|
|
- if (!deleteFile.getAbsolutePath().contains("images")) {
|
|
|
- if (deleteFile.isDirectory()) {
|
|
|
- FileUtils.delAllFile(deleteFile.getAbsolutePath());
|
|
|
- } else {
|
|
|
- FileUtils.deleteFile(deleteFile.getAbsolutePath());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ FileUtils.deleteDirectory(path + File.separator + "caches");
|
|
|
}
|
|
|
//删除上一次计算出来的result目录
|
|
|
if (new File(path + File.separator + "results").exists()) {
|