diff --git a/backend/src/main/java/io/metersphere/consul/ConsulService.java b/backend/src/main/java/io/metersphere/consul/ConsulService.java index 648a470fe6..f66a267713 100644 --- a/backend/src/main/java/io/metersphere/consul/ConsulService.java +++ b/backend/src/main/java/io/metersphere/consul/ConsulService.java @@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; import io.metersphere.base.domain.TestResource; import io.metersphere.commons.constants.PerformanceTestStatus; import io.metersphere.commons.constants.ResourcePoolTypeEnum; +import io.metersphere.commons.constants.ResourceStatusEnum; +import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest; import io.metersphere.dto.LoadTestDTO; import io.metersphere.dto.NodeDTO; import io.metersphere.dto.TestResourcePoolDTO; @@ -28,7 +30,9 @@ public class ConsulService { public Map> getActiveNodes() { Map> result = new HashMap<>(); - List testResourcePoolDTOS = testResourcePoolService.listValidResourcePools(); + QueryResourcePoolRequest resourcePoolRequest = new QueryResourcePoolRequest(); + resourcePoolRequest.setStatus(ResourceStatusEnum.VALID.name()); + List testResourcePoolDTOS = testResourcePoolService.listResourcePools(resourcePoolRequest); QueryTestPlanRequest request = new QueryTestPlanRequest(); request.setFilters(new HashMap>() {{ put("status", Arrays.asList(PerformanceTestStatus.Starting.name(), PerformanceTestStatus.Running.name()));