孟令鑫 1 ano atrás
pai
commit
2c7e2d68a7

+ 1 - 1
simulation-resource-monitor/src/main/java/com/css/simulation/resource/monitor/acl/service/impl/AlgorithmExpandAclServiceImpl.java

@@ -58,7 +58,7 @@ public class AlgorithmExpandAclServiceImpl implements AlgorithmExpandAclService
         if (ObjectUtil.isNull(token)) {
            throw new RuntimeException("获取算法平台token失败。");
         }
-        String algorithmListUri = algorithmExpandConfigurationAclEntity.getAlgorithmListUri()+ "?sort=algorithmId-desc&access_token=" + token;
+        String algorithmListUri = algorithmExpandConfigurationAclEntity.getAlgorithmListUri()+ "?sort=algorithmId-desc&page=0&size=999999&access_token=" + token;
         String httpResponseString = HttpUtil.get(HttpUtil.getHttpClient(), HttpUtil.getRequestConfig(), algorithmListUri);
         log.info("算法平台请求结果为:{}", httpResponseString);
         final String algorithmListJson = JsonUtil.getString(httpResponseString, "data.content");

+ 7 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/adapter/consumer/ProjectConsumer.java

@@ -11,6 +11,7 @@ import org.springframework.kafka.annotation.KafkaListener;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.util.concurrent.TimeUnit;
 
 @Slf4j
 @Component
@@ -35,7 +36,12 @@ public class ProjectConsumer {
     @KafkaListener(groupId = "simulation-resource-scheduler", topics = "${custom.mq-stop-project-topic}")
     public void stopProject(ConsumerRecord<String, String> projectStopMessageRecord) {
         log.info("消费者组 simulation-resource-scheduler 接收到的项目终止消息:" + projectStopMessageRecord);
-        projectApplicationService.stopProject(JsonUtil.jsonToBean(projectStopMessageRecord.value(), ProjectStopMessageEntity.class));
+        try {
+            TimeUnit.SECONDS.sleep(10);
+            projectApplicationService.stopProject(JsonUtil.jsonToBean(projectStopMessageRecord.value(), ProjectStopMessageEntity.class));
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
     }