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

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2512>
This commit is contained in:
Petitminion 2023-06-09 12:27:02 +02:00 committed by Marge
parent c7e9152590
commit dac14a36e5
2 changed files with 2 additions and 1 deletions

View File

@ -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.")

View File

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