From e48f592e95eac804803ee534170df4404bfea58f Mon Sep 17 00:00:00 2001 From: Varun Date: Fri, 21 Mar 2025 17:08:01 +0530 Subject: [PATCH] changes --- src/controllers/tanksController.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index dd6286c2..b8912aed 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2973,6 +2973,7 @@ exports.motorAction = async (req, reply) => { motorIntervals[motorId] = setInterval(async () => { + console.log(motorId,"interval created") const supplierTank = await Tank.findOne({ customerId, tankName: req.body.from, tankLocation: req.body.from_type.toLowerCase() }); const currentWaterLevel = parseInt(supplierTank.waterlevel, 10); const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; @@ -2995,15 +2996,15 @@ exports.motorAction = async (req, reply) => { } else { console.log("🚀 Sending threshold time notification..."); - // eventEmitter.emit( - // "sendThresholdTimeNotification", - // customerId, - // fcmToken, - // manual_threshold_time, - // motorId, - // tankName, - // blockName - // ); + eventEmitter.emit( + "sendThresholdTimeNotification", + customerId, + fcmToken, + manual_threshold_time, + motorId, + tankName, + blockName + ); } // eventEmitter.emit( // "sendThresholdTimeNotification",