线程池实例页面多实例不同 Active 展示错误. (#72)

pull/84/head
chen.ma 3 years ago
parent 6e3de8c253
commit 8a4a472785

@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static cn.hippo4j.common.toolkit.ContentUtil.getGroupKey;
@ -72,12 +73,15 @@ public class ThreadPoolController {
String itemTenantKey = holder.getGroupKey();
String groupKey = getGroupKey(tpId, itemTenantKey);
Map<String, CacheItem> content = ConfigCacheService.getContent(groupKey);
Map<String, String> activeMap = leases.stream()
.map(each -> each.getHolder())
.collect(Collectors.toMap(InstanceInfo::getIdentify, InstanceInfo::getActive));
List<ThreadPoolInstanceInfo> returnThreadPool = Lists.newArrayList();
content.forEach((key, val) -> {
ThreadPoolInstanceInfo threadPoolInstanceInfo = BeanUtil.convert(val.configAllInfo, ThreadPoolInstanceInfo.class);
threadPoolInstanceInfo.setClientAddress(StrUtil.subBefore(key, Constants.IDENTIFY_SLICER_SYMBOL, false));
threadPoolInstanceInfo.setActive(holder.getActive());
threadPoolInstanceInfo.setActive(activeMap.get(key));
threadPoolInstanceInfo.setIdentify(key);
threadPoolInstanceInfo.setClientBasePath(holder.getClientBasePath());
returnThreadPool.add(threadPoolInstanceInfo);

Loading…
Cancel
Save