Reduced code complexity
This commit is contained in:
parent
604f5b8d25
commit
f5b22510af
@ -399,14 +399,10 @@ public final class EdgeGrpcSession implements Closeable {
|
|||||||
Runnable sendDownlinkMsgsTask = () -> {
|
Runnable sendDownlinkMsgsTask = () -> {
|
||||||
try {
|
try {
|
||||||
if (isConnected() && sessionState.getPendingMsgsMap().values().size() > 0) {
|
if (isConnected() && sessionState.getPendingMsgsMap().values().size() > 0) {
|
||||||
List<DownlinkMsg> copy = null;
|
List<DownlinkMsg> copy = new ArrayList<>(sessionState.getPendingMsgsMap().values());
|
||||||
if (!firstRun) {
|
if (!firstRun) {
|
||||||
copy = new ArrayList<>(sessionState.getPendingMsgsMap().values());
|
|
||||||
log.warn("[{}] Failed to deliver the batch: {}", this.sessionId, copy);
|
log.warn("[{}] Failed to deliver the batch: {}", this.sessionId, copy);
|
||||||
}
|
}
|
||||||
if (copy == null) {
|
|
||||||
copy = new ArrayList<>(sessionState.getPendingMsgsMap().values());
|
|
||||||
}
|
|
||||||
log.trace("[{}] [{}] downlink msg(s) are going to be send.", this.sessionId, copy.size());
|
log.trace("[{}] [{}] downlink msg(s) are going to be send.", this.sessionId, copy.size());
|
||||||
for (DownlinkMsg downlinkMsg : copy) {
|
for (DownlinkMsg downlinkMsg : copy) {
|
||||||
sendDownlinkMsg(ResponseMsg.newBuilder()
|
sendDownlinkMsg(ResponseMsg.newBuilder()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user