Merge pull request #12282 from jekka001/fix/edge-hp-events

Fix widget type sync up
This commit is contained in:
Viacheslav Klimov 2024-12-18 12:20:46 +02:00 committed by GitHub
commit d87d1d553d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,7 +135,7 @@ public abstract class EdgeGrpcSession implements Closeable {
private StreamObserver<RequestMsg> inputStream; private StreamObserver<RequestMsg> inputStream;
private StreamObserver<ResponseMsg> outputStream; private StreamObserver<ResponseMsg> outputStream;
private boolean connected; private volatile boolean connected;
private volatile boolean syncCompleted; private volatile boolean syncCompleted;
private EdgeVersion edgeVersion; private EdgeVersion edgeVersion;
@ -536,6 +536,7 @@ public abstract class EdgeGrpcSession implements Closeable {
public void processHighPriorityEvents() { public void processHighPriorityEvents() {
try { try {
if (isConnected() && isSyncCompleted()) {
List<EdgeEvent> highPriorityEvents = new ArrayList<>(); List<EdgeEvent> highPriorityEvents = new ArrayList<>();
EdgeEvent event; EdgeEvent event;
while ((event = highPriorityQueue.poll()) != null) { while ((event = highPriorityQueue.poll()) != null) {
@ -543,6 +544,7 @@ public abstract class EdgeGrpcSession implements Closeable {
} }
List<DownlinkMsg> downlinkMsgsPack = convertToDownlinkMsgsPack(highPriorityEvents); List<DownlinkMsg> downlinkMsgsPack = convertToDownlinkMsgsPack(highPriorityEvents);
sendDownlinkMsgsPack(downlinkMsgsPack).get(); sendDownlinkMsgsPack(downlinkMsgsPack).get();
}
} catch (Exception e) { } catch (Exception e) {
log.error("[{}] Failed to process high priority events", sessionId, e); log.error("[{}] Failed to process high priority events", sessionId, e);
} }