Skip to content
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

update behavior of app.result_expires to match celery docs #401

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions django_celery_results/backends/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def _forget(self, task_id):

def cleanup(self):
"""Delete expired metadata."""
if not self.expires:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would love to see unit test for this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not covered in current unit tests, I didn't consider it the responsibility of this PR to add missing coverage. However, I can add a unit test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add a basic unit test for this added change or that function as you like

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be helpful if you can add a basic unit test so we can merge with confidence

return
self.TaskModel._default_manager.delete_expired(self.expires)
self.GroupModel._default_manager.delete_expired(self.expires)

Expand Down