diff --git a/src/main/java/com/target/devicemanager/components/scale/ScaleDevice.java b/src/main/java/com/target/devicemanager/components/scale/ScaleDevice.java index 8593073..5e53230 100644 --- a/src/main/java/com/target/devicemanager/components/scale/ScaleDevice.java +++ b/src/main/java/com/target/devicemanager/components/scale/ScaleDevice.java @@ -203,9 +203,9 @@ void startStableWeightRead(int timeout) { return; } catch (JposException jposException) { if(isConnected()) { - LOGGER.error(MARKER, "Scale Failed to Read Stable Weight: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); + LOGGER.trace("Scale Failed to Read Stable Weight: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); } else { - LOGGER.error(MARKER, "Scale not connected in Read Stable Weight: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); + LOGGER.trace("Scale not connected in Read Stable Weight: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); } if(jposException.getErrorCode() != JposConst.JPOS_E_TIMEOUT) { fireScaleWeightErrorEvent(jposException); diff --git a/src/main/java/com/target/devicemanager/components/scale/ScaleManager.java b/src/main/java/com/target/devicemanager/components/scale/ScaleManager.java index 9520117..81f3805 100644 --- a/src/main/java/com/target/devicemanager/components/scale/ScaleManager.java +++ b/src/main/java/com/target/devicemanager/components/scale/ScaleManager.java @@ -113,7 +113,7 @@ void subscribeToLiveWeight(SseEmitter liveWeightEmitter) throws IOException { } public FormattedWeight getStableWeight(CompletableFuture stableWeightClient) throws ScaleException { - if (scaleDevice.tryLock() && isScaleReady()) { + if (isScaleReady() && scaleDevice.tryLock()) { //Create new future and add it to the list stableWeightClients.add(stableWeightClient); scaleDevice.startStableWeightRead(STABLE_WEIGHT_TIMEOUT_MSEC);