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:
parent
c7e9152590
commit
dac14a36e5
|
@ -22,7 +22,7 @@ class Command(BaseCommand):
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
skipped = models.Upload.objects.filter(import_status="skipped")
|
skipped = models.Upload.objects.filter(import_status="skipped")
|
||||||
count = len(skipped)
|
count = skipped.count()
|
||||||
if options["force"]:
|
if options["force"]:
|
||||||
skipped.delete()
|
skipped.delete()
|
||||||
print(f"Deleted {count} entries from the database.")
|
print(f"Deleted {count} entries from the database.")
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fix Prune skipped uploads is OOM killed (#2136)
|
Loading…
Reference in New Issue