New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: raw delete expired instead of Queryset.delete
#235
Changes from 4 commits
0b63256
c256d82
350aeb1
df10206
ed859b5
6559dd9
e15a3de
d3099e3
9c65797
113ac2e
b8aaad2
ba0efdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ | |||||||||||||||
from django.conf import settings | ||||||||||||||||
from django.db import connections, models, router, transaction | ||||||||||||||||
|
||||||||||||||||
from .utils import now | ||||||||||||||||
from .utils import now, raw_delete | ||||||||||||||||
|
||||||||||||||||
W_ISOLATION_REP = """ | ||||||||||||||||
Polling results with transaction isolation level 'repeatable-read' | ||||||||||||||||
|
@@ -88,7 +88,7 @@ def get_all_expired(self, expires): | |||||||||||||||
def delete_expired(self, expires): | ||||||||||||||||
"""Delete all expired results.""" | ||||||||||||||||
with transaction.atomic(): | ||||||||||||||||
self.get_all_expired(expires).delete() | ||||||||||||||||
raw_delete(queryset=self.get_all_expired(expires)) | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another thing i want to be assured that running makemigrations detect any change in migrations There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added similar test for Should we implement the same? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that would be great! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already this test which does that. django-celery-results/t/unit/test_migrations.py Lines 26 to 32 in 0a00044
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we replace this with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which part do you want to replace with what? can you elaborate please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. made those changes. Please review. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. commit - 113ac2e |
||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
class TaskResultManager(ResultManager): | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests for this method needs to be updated as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what kind of update? the current test looks sufficient to me.