Fix jwt-token

This commit is contained in:
2025-09-22 08:02:07 +02:00
parent a258543224
commit e8c5306e10
2 changed files with 12 additions and 5 deletions

View File

@@ -369,14 +369,16 @@ class AlertService {
model: DroneDetection,
as: 'detection',
where: {
device_id: detection.device_id,
drone_id: detection.drone_id
}
device_id: detection.device_id
// Removed drone_id check - cooldown applies per device, not per device+drone combination
// This prevents alert spam when multiple drones are detected by the same device
},
required: false // Allow alerts without detection_id (like device offline alerts)
}]
});
if (recentAlert) {
console.log(`❌ Rule "${rule.name}": Still in cooldown period`);
console.log(`❌ Rule "${rule.name}": Still in cooldown period (last alert: ${recentAlert.sent_at})`);
return false;
}
}