Skip to content

Commit

Permalink
Revert "feat: raw delete expired instead of Queryset.delete (celery…
Browse files Browse the repository at this point in the history
…#235)"

This partially reverts commit 7c7cb67.
  • Loading branch information
hansegucker committed Apr 22, 2023
1 parent 28d9101 commit 210f7d5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 48 deletions.
4 changes: 2 additions & 2 deletions django_celery_results/managers.py
Expand Up @@ -8,7 +8,7 @@
from django.conf import settings
from django.db import connections, models, router, transaction

from .utils import now, raw_delete
from .utils import now

W_ISOLATION_REP = """
Polling results with transaction isolation level 'repeatable-read'
Expand Down Expand Up @@ -87,7 +87,7 @@ def get_all_expired(self, expires):
def delete_expired(self, expires):
"""Delete all expired results."""
with transaction.atomic(using=self.db):
raw_delete(queryset=self.get_all_expired(expires))
self.get_all_expired(expires).delete()


class TaskResultManager(ResultManager):
Expand Down
5 changes: 0 additions & 5 deletions django_celery_results/utils.py
Expand Up @@ -15,8 +15,3 @@ def now():
return now_localtime(timezone.now())
else:
return timezone.now()


def raw_delete(queryset):
"""Raw delete given queryset."""
return queryset._raw_delete(queryset.db)
41 changes: 0 additions & 41 deletions t/unit/test_utils.py

This file was deleted.

0 comments on commit 210f7d5

Please sign in to comment.