Merge pull request #12282 from jekka001/fix/edge-hp-events
Fix widget type sync up
This commit is contained in:
commit
d87d1d553d
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user