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