Merge remote-tracking branch 'origin/master' into develop/3.5.2
This commit is contained in:
commit
774ac81fb0
@ -50,7 +50,6 @@ import java.util.Queue;
|
|||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -176,17 +175,6 @@ public class TbMathNode implements TbNode {
|
|||||||
return resultMsgFuture;
|
return resultMsgFuture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean tryAcquire(EntityId originator, Semaphore originatorSemaphore) {
|
|
||||||
boolean acquired;
|
|
||||||
try {
|
|
||||||
acquired = originatorSemaphore.tryAcquire(20, TimeUnit.SECONDS);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
acquired = false;
|
|
||||||
log.debug("[{}] Failed to acquire semaphore", originator, e);
|
|
||||||
}
|
|
||||||
return acquired;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ListenableFuture<TbMsg> updateMsgAndDb(TbContext ctx, TbMsg msg, Optional<ObjectNode> msgBodyOpt, double result) {
|
private ListenableFuture<TbMsg> updateMsgAndDb(TbContext ctx, TbMsg msg, Optional<ObjectNode> msgBodyOpt, double result) {
|
||||||
TbMathResult mathResultDef = config.getResult();
|
TbMathResult mathResultDef = config.getResult();
|
||||||
String mathResultKey = getKeyFromTemplate(msg, mathResultDef.getType(), mathResultDef.getKey());
|
String mathResultKey = getKeyFromTemplate(msg, mathResultDef.getType(), mathResultDef.getKey());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user