-
Notifications
You must be signed in to change notification settings - Fork 24
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
Delete and retry tasks through Django Admin #92
base: master
Are you sure you want to change the base?
Conversation
from .models import DBTaskResult | ||
|
||
|
||
def retry(modeladmin: "DBTaskResultAdmin", request, queryset): | ||
rows = queryset.update(status=ResultStatus.NEW) |
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.
@RealOrangeOne I'm not sure if it's a good idea to reuse DBTaskResult
rows; maybe we should be creating new rows instead. What do you think?
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.
For my use case (processing a bunch of documents), I find it useful to be able to retry failed tasks, until there are none left, fixing errors in the process. If we were to create new rows, then I'd have to stop the queue, retry the tasks, delete the old tasks, and then restart the queue.
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.
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.
Then we shall have both! I've updated the PR as you suggest, with a small test to make sure that duplicate tasks actually work.
faae1df
to
a608fc1
Compare
I found it super useful to be able to delete and to reschedule tasks through the Django Admin.
Update – this PR now adds two admin actions:
status
of the selected tasks toNEW
, so they will be executed again.NEW
, with no result or started/finished timestamps.