From 204ba9101080c6c887c5972cf490dc32660e7782 Mon Sep 17 00:00:00 2001 From: Charitha Goonetilleke Date: Fri, 17 Mar 2023 16:20:57 +0530 Subject: [PATCH] Remove unnecessary logs --- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 27882f4fbd..46b2b8ff83 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.core.operation.mgt; +import com.google.gson.Gson; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -792,15 +793,16 @@ public class OperationManagerImpl implements OperationManager { if (dtoOperation != null) { long currentTime = Calendar.getInstance().getTime().getTime(); - log.info("Current timestamp:" + currentTime); long updatedTime = Timestamp.valueOf(dtoOperation.getReceivedTimeStamp()).getTime(); - log.info("Updated timestamp: " + updatedTime); // check if notnow frequency is met and set next pending operation if not, otherwise let notnow // operation to proceed if ((currentTime - updatedTime) < notNowOperationFrequency) { dtoOperation = operationDAO.getNextOperation(enrolmentInfo.getId(), org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.PENDING); + } else { + log.warn("Updated timestamp (" + updatedTime + ") of operation (" + + new Gson().toJson(dtoOperation) + ") is ahead from current: " + currentTime); } } else { dtoOperation = operationDAO.getNextOperation(enrolmentInfo.getId(),