perf: 优化开机时候和采集异常触发的断线重连

main
huangfeng 6 months ago
parent 11731782f3
commit 3f7b3a0dc6

@ -90,9 +90,8 @@ public class IEDCollectService {
_webSocketServer.sendMessage(err, null);
}
if (ex instanceof SocketException) {
NetErrorThread thread = new NetErrorThread();
thread.iedId = ied.getId();
thread.run();
NetErrorThread thread = new NetErrorThread(ied.getId());
thread.start();
}
} finally {
iecClient.disconnect();

@ -5,6 +5,10 @@ import com.xydl.cac.model.StaticVariable;
public class NetErrorThread extends Thread {
public int iedId;
public NetErrorThread(Integer iedid) {
iedId = iedid;
}
@Override
public void run() {
IecClient iecClient = StaticVariable.realTimeClientMap.get(iedId);

@ -38,6 +38,8 @@ public class RealTimeDataService {
try {
this.startCollect(ied);
} catch (Exception ignore) {
NetErrorThread thread = new NetErrorThread(ied.getId());
thread.start();
}
}
}

Loading…
Cancel
Save