Fix jwt-token
This commit is contained in:
@@ -716,9 +716,16 @@ class AlertService {
|
||||
*/
|
||||
async checkAlertRules(detection) {
|
||||
try {
|
||||
// Get the device to determine tenant context
|
||||
const device = await Device.findByPk(detection.device_id);
|
||||
if (!device) {
|
||||
console.log(`Device ${detection.device_id} not found for detection`);
|
||||
return [];
|
||||
}
|
||||
|
||||
const rules = await AlertRule.findAll({
|
||||
where: {
|
||||
tenant_id: detection.tenant_id,
|
||||
tenant_id: device.tenant_id,
|
||||
is_active: true
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user