fix: Avoid high memory usage when pruning a lot of skipped uploads

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2512>
environments/review-docs-2173-fg9d5z/deployments/18027
Petitminion 2023-06-09 12:27:02 +02:00 zatwierdzone przez Marge
rodzic c7e9152590
commit dac14a36e5
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ class Command(BaseCommand):
@transaction.atomic
def handle(self, *args, **options):
skipped = models.Upload.objects.filter(import_status="skipped")
count = len(skipped)
count = skipped.count()
if options["force"]:
skipped.delete()
print(f"Deleted {count} entries from the database.")

Wyświetl plik

@ -0,0 +1 @@
Fix Prune skipped uploads is OOM killed (#2136)