From a1f518fdf217f8a11ecd8de01fa110edf6116014 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Mon, 20 Jan 2025 16:26:38 +0530 Subject: [PATCH 1/2] chnages --- src/controllers/tanksController.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 7da84e2c..84df5da0 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2201,7 +2201,7 @@ console.log(fcmToken) motorIntervals[motorId] = setTimeout(async () => { try { // Perform threshold time logic (e.g., notification, motor stop) - console.log(`Threshold time of ${manualThresholdTime} minutes reached for motor ${motorId}`); + console.log(`Threshold time of ${manual_threshold_time} minutes reached for motor ${motorId}`); await Tank.updateOne( { customerId, "connections.inputConnections.motor_id": motorId }, { $set: { "connections.inputConnections.$.motor_stop_status": "1" } } @@ -2248,8 +2248,8 @@ console.log(fcmToken) } ); - const startMessage = `Motor supplying water to '${tankName}' in block '${blockName}' started manually at ${startTime}.`; - eventEmitter.emit('sendMotorStartNotification', fcmToken, startMessage); + // const startMessage = `Motor supplying water to '${tankName}' in block '${blockName}' started manually at ${startTime}.`; + // eventEmitter.emit('sendMotorStartNotification', fcmToken, startMessage); // Schedule threshold check // const thresholdTimeMs = manual_threshold_time * 60 * 1000; @@ -2336,8 +2336,8 @@ console.log(fcmToken) } ); - const stopMessage = `Motor supplying water to '${tankName}' in block '${blockName}' stopped manually at ${stopTime}.`; - eventEmitter.emit('sendMotorStopNotification', fcmToken, stopMessage); + // const stopMessage = `Motor supplying water to '${tankName}' in block '${blockName}' stopped manually at ${stopTime}.`; + // eventEmitter.emit('sendMotorStopNotification', fcmToken, stopMessage); if (motorIntervals[motorId]) { clearTimeout(motorIntervals[motorId]); From 8e6900e6c7df4623707041491b47eb23bda8f2b6 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Mon, 20 Jan 2025 17:36:12 +0530 Subject: [PATCH 2/2] chnages --- src/controllers/tanksController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 84df5da0..46cdf23c 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2255,8 +2255,8 @@ console.log(fcmToken) // const thresholdTimeMs = manual_threshold_time * 60 * 1000; motorIntervals[motorId] = setTimeout(async () => { try { - const stopMessage = `Threshold time of ${manual_threshold_time} minutes reached for motor supplying water to '${tankName}' in block '${blockName}'.`; - eventEmitter.emit('sendThresholdTimeNotification', fcmToken, stopMessage); + // const stopMessage = `Threshold time of ${manual_threshold_time} minutes reached for motor supplying water to '${tankName}' in block '${blockName}'.`; + // eventEmitter.emit('sendThresholdTimeNotification', fcmToken, stopMessage); await Tank.updateOne( { customerId, "connections.inputConnections.motor_id": motorId },