perf: 优化停止订阅处理

dev
huangfeng 8 months ago
parent 6211c75a93
commit c5e66d9e03

@ -119,7 +119,11 @@ public class IecClient implements ClientEventListener {
} catch (Exception ignore) {
}
}
log.info("61850停止订阅, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort());
if (keep) {
log.warn("61850订阅已断开, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort());
} else {
log.info("61850停止订阅, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort());
}
}
public List<FileInformation> listFile(String path) throws Exception {
@ -147,7 +151,6 @@ public class IecClient implements ClientEventListener {
if (keep) {
this.disableReporting();
this.disconnect();
log.warn("61850订阅已断开, ied=" + ied.getName() + ", ip=" + ied.getIp() + ", port=" + ied.getPort());
while (retry > 0) {
retry--;
try {

@ -16,10 +16,7 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.*;
@Service
@Slf4j
@ -104,9 +101,12 @@ public class RealTimeDataService {
@PreDestroy
private void stop() {
log.info("关闭61850订阅服务.");
List<Integer> idList = new ArrayList<>();
Iterator<Integer> it = clientMap.keySet().iterator();
while (it.hasNext()) {
Integer iedId = it.next();
idList.add(it.next());
}
for (Integer iedId : idList) {
this.onlyStop(iedId);
}
}

Loading…
Cancel
Save