From 5f4fda3abf6f8500cf94f065e5d094721ac3f316 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Sat, 28 Sep 2024 11:57:07 +0200 Subject: [PATCH] Add iterator() call in BatchInspector, to prevent Celery worker from getting killed (#123) --- tagging/batchinspector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tagging/batchinspector.py b/tagging/batchinspector.py index e5304cf..1b621da 100644 --- a/tagging/batchinspector.py +++ b/tagging/batchinspector.py @@ -80,6 +80,6 @@ def inspect_batches_since(self, since_time): batches modified since the given time. """ queryset = Batch.objects.filter(Q(tags__id__in = self.tags_for_diff_inspection) | Q(nb_new_pages__gt = 0), last_modified__gt=since_time, archived=False).order_by('ended').distinct() - for batch in queryset: + for batch in queryset.iterator(): self.add_missing_tags(batch)