From d57be2c00c950f4b7a97062ac7ae256f43a0e88e Mon Sep 17 00:00:00 2001 From: Pahansith Date: Fri, 5 Apr 2024 10:19:26 +0530 Subject: [PATCH] Change debug enabled check for performance optimization --- .../device/details/mgt/impl/DeviceInformationManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index 0facad3b30..9846b85419 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -208,8 +208,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { deviceDetailsWrapper.setEvents(payload); Future apiCallback = publishEvents(device, deviceDetailsWrapper, eventType); if (null != apiCallback) { + boolean isDebugEnabled = log.isDebugEnabled(); while(!apiCallback.isDone()) { - if (log.isDebugEnabled()) { + if (isDebugEnabled) { log.debug("Waiting for the response from the API for the reporting data " + "publishing for the device " + deviceId + ". Event payload: " + payload); }