From 45a03f5aacacb1da78b47d5294d6b6a14bcca51e Mon Sep 17 00:00:00 2001 From: Varun Date: Wed, 29 Jan 2025 14:39:18 +0530 Subject: [PATCH 1/2] checking motoraction --- src/controllers/tanksController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 364dc8ac..fc23288f 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -3017,9 +3017,12 @@ exports.motorAction = async (req, reply) => { delete motorIntervals[motorId]; // Remove from interval object this.publishMotorStopStatus(motorId, "1"); + console.log(start_instance_id,"start_instance_id",customerId,"customerId",motorId,"motorId") const motorData = await MotorData.findOne({ customerId, motor_id: motorId, start_instance_id: start_instance_id }); + console.log(motorData,"motorData") if (motorData) { + console.log("got into if") const receiverTank = await Tank.findOne({ customerId, tankName: motorData.receiverTank, tankLocation: motorData.receiver_type.toLowerCase() }); const receiverFinalWaterLevel = parseInt(receiverTank.waterlevel, 10); const quantityDelivered = receiverFinalWaterLevel - parseInt(motorData.receiverInitialwaterlevel, 10); From 1b60e2eab039e53525e695a6cf0730df2e6d6710 Mon Sep 17 00:00:00 2001 From: Varun Date: Wed, 29 Jan 2025 14:41:51 +0530 Subject: [PATCH 2/2] checking --- src/controllers/tanksController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index fc23288f..251bd0f6 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2889,9 +2889,10 @@ exports.motorAction = async (req, reply) => { // Perform stop operations in the background (async () => { - + console.log(start_instance_id,"start_instance_id",customerId,"customerId",motorId,"motorId") const motorData = await MotorData.findOne({ customerId, motor_id: motorId, start_instance_id: start_instance_id }); if (motorData) { + console.log("entered if in stop") const receiverTank = await Tank.findOne({ customerId, tankName: motorData.receiverTank, tankLocation: motorData.receiver_type.toLowerCase() }); const receiverFinalWaterLevel = parseInt(receiverTank.waterlevel, 10); const quantityDelivered = receiverFinalWaterLevel - parseInt(motorData.receiverInitialwaterlevel, 10);