master^2
Varun 7 months ago
parent e2800f416c
commit d193d62c2e

@ -2867,8 +2867,16 @@ exports.motorAction = async (req, reply) => {
if (action === "start") { if (action === "start") {
if (motorIntervals[motorId]) { if (motorIntervals[motorId]) {
console.log(`🛑 Clearing interval for motorId: ${motorId}`);
clearInterval(motorIntervals[motorId]); clearInterval(motorIntervals[motorId]);
delete motorIntervals[motorId]; delete motorIntervals[motorId];
// Confirm deletion
if (!motorIntervals[motorId]) {
console.log(`✅ Interval for motorId: ${motorId} successfully deleted.`);
} else {
console.error(`❌ Failed to delete interval for motorId: ${motorId}`);
}
} }
const startTime = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm'); const startTime = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm');
@ -5971,14 +5979,14 @@ async function processIotData(hw_Id, data) {
// function logSets() { function logSets() {
// console.log("Subscribed Topics:", Array.from(subscribedTopics)); console.log("Subscribed Topics:", Array.from(subscribedTopics));
// console.log("Active Devices:", Array.from(activeDevices)); console.log("Active Devices:", Array.from(activeDevices));
// console.log("motorIntervals:", motorIntervals); console.log("motorIntervals:", motorIntervals);
// } }
// // Call logSets every 30 seconds // Call logSets every 30 seconds
// setInterval(logSets, 30000); setInterval(logSets, 30000);

Loading…
Cancel
Save