-
Notifications
You must be signed in to change notification settings - Fork 206
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
Meta injection #366
Meta injection #366
Conversation
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.
can you please check the CI failures?
Yes, I was awaiting the maintainer approval for the CI to run 😁 |
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.
anything else you want to add or improve in this PR?
No, for me it's good to go 🚀 |
There's a roadmap with this PR on a release? There's a expected date for the new version? |
if possible this week, if not in this month |
@rodrigondec @auvipy I still have this problem with the latest version (2.5.1)
|
@cdevacc1 I have the same problem, see issue #367. In your screenshot though, I think it might be because |
@ericswpark Yes. I looked through models.py, status must be in celery.states.ALL_STATES
ShouId I remove choices from status field to make it work with custom states? |
@cdevacc1 that would be great :) |
For me the example from the "injecting-metadata" file is not working at all. No matter what i do, the information i put in request.meta or the update_state function, the info is nowhere to be found :( "Result Data" only shows the pid and hostname. ( i dont write that in there, so must come from somewhere else ^^ ) |
From celery#366 (comment) Thanks to @cdevacc1 for the idea. I just decided to write up the PR as it only takes a couple of minutes. This should resolve the bug where custom states are not shown at all in the admin panel.
@cdevacc1 decided to tackle this issue today so I just made a PR from your comment. See ^ |
From celery#366 (comment) Thanks to @cdevacc1 for the idea. I just decided to write up the PR as it only takes a couple of minutes. This should resolve the bug where custom states are not shown at all in the admin panel.
Resume
The issue #37 points to save data using the arg
meta
from the methodupdate_state
, but themeta
attribute is renamed toresult
when it is passed toself.backend.store_result
.As explained here in this comment #37 (comment).
Problem
So the argued
meta
arg onstore_result
is not really arbitrary metadata. It's actually the result of the Task.Solution
Use the TaskResult.meta to store arbitrary data.
How to inject?
I implemented the meta injection through the Task Celery Request. This way I don't mess around with too many implementations and function signatures.