Fix jwt-token
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user