|
|
@@ -2,7 +2,6 @@ package com.fdkankan.modeling;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -33,8 +32,6 @@ public class ModelingApplication implements CommandLineRunner {
|
|
|
@Value("${spring.profiles.active:#{null}}")
|
|
|
private String profiles;
|
|
|
|
|
|
- @Autowired(required = false)
|
|
|
- private Optional<FYunFileServiceInterface> fYunFileService;
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
@@ -48,20 +45,20 @@ public class ModelingApplication implements CommandLineRunner {
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
|
|
|
- log.info("fYunFileService.isPresent():{}", fYunFileService.isPresent());
|
|
|
- if(fYunFileService.isPresent() && StrUtil.isNotEmpty(profiles)){
|
|
|
- //更新弹性伸缩jar包
|
|
|
- boolean lock = redisLockUtil.lock("uploadModelingJar", 300);
|
|
|
- try {
|
|
|
- if(lock){
|
|
|
- String jarPath = System.getProperty("java.class.path");
|
|
|
- fYunFileService.get().uploadFile(jarPath, "elastic_model_jar/fdkk_" + profiles + "/" + FileUtil.getName(jarPath));
|
|
|
- }
|
|
|
- }finally {
|
|
|
- redisLockUtil.unlockLua("uploadModelingJar");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// log.info("fYunFileService.isPresent():{}", fYunFileService.isPresent());
|
|
|
+// if(fYunFileService.isPresent() && StrUtil.isNotEmpty(profiles)){
|
|
|
+// //更新弹性伸缩jar包
|
|
|
+// boolean lock = redisLockUtil.lock("uploadModelingJar", 300);
|
|
|
+// try {
|
|
|
+// if(lock){
|
|
|
+// String jarPath = System.getProperty("java.class.path");
|
|
|
+// fYunFileService.get().uploadFile(jarPath, "elastic_model_jar/fdkk_" + profiles + "/" + FileUtil.getName(jarPath));
|
|
|
+// }
|
|
|
+// }finally {
|
|
|
+// redisLockUtil.unlockLua("uploadModelingJar");
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
}
|
|
|
}
|