diff --git a/promgen/tasks.py b/promgen/tasks.py index ef3b9a796..6dcf71120 100644 --- a/promgen/tasks.py +++ b/promgen/tasks.py @@ -43,6 +43,10 @@ def process_alert(alert_pk): alert.delete() return + # After processing our blacklist, it should be safe to queue our + # alert to also index the labels + index_alert.delay(alert.pk) + # Now that we have our routable items, we want to check which senders are # configured and expand those as needed senders = collections.defaultdict(set) diff --git a/promgen/views.py b/promgen/views.py index 15b808273..24cd6c4cf 100644 --- a/promgen/views.py +++ b/promgen/views.py @@ -1019,7 +1019,6 @@ def post(self, request, *args, **kwargs): # when we run tasks.process_alert alert = models.Alert.objects.create(body=request.body.decode("utf-8")) tasks.process_alert.delay(alert.pk) - tasks.index_alert.delay(alert.pk) return HttpResponse("OK", status=202)