master^2
Varun 7 months ago
parent 183961299a
commit e48f592e95

@ -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",

Loading…
Cancel
Save