Unverified Commit 1e9dd3b3 authored by William Grzybowski's avatar William Grzybowski Committed by GitHub
Browse files

Merge pull request #4848 from freenas/NAS-106197

NAS-106197 / 11.3 / Alert collisions are inevitable on TN HA; ignore them
Showing with 20 additions and 7 deletions
+20 -7
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-05-27 10:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('system', '0046_legacy_ui'),
]
operations = [
migrations.AlterUniqueTogether(
name='alert',
unique_together=set([]),
),
]
......@@ -492,11 +492,6 @@ class Alert(Model):
dismissed = models.BooleanField()
text = models.TextField()
class Meta:
unique_together = (
('node', 'klass', 'key'),
)
class AlertClasses(Model):
classes = DictField(
......
......@@ -204,7 +204,8 @@ class AlertService(Service):
alert = Alert(**alert)
self.alerts.append(alert)
if not any(a.uuid == alert.uuid for a in self.alerts):
self.alerts.append(alert)
self.alert_source_last_run = defaultdict(lambda: datetime.min)
......@@ -700,7 +701,7 @@ class AlertService(Service):
return alerts
@periodic(3600)
@periodic(3600, run_on_start=False)
@private
async def flush_alerts(self):
if (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment