-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
[14.0][IMP] queue_job: automatically update dependent jobs when state changes manually #676
[14.0][IMP] queue_job: automatically update dependent jobs when state changes manually #676
Conversation
- an explicit flush is needed or child jobs won't be updated - no need to forward port, this was fixed already in 16.0+
Hi @guewen, |
@@ -308,13 +308,16 @@ def _change_job_state(self, state, result=None): | |||
if state == DONE: | |||
job_.set_done(result=result) | |||
job_.store() | |||
record.env["queue.job"].flush() |
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.
Why is this flush necessary? This isn't the code path that was changed.
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.
Thanks!
This PR has the |
/ocabot merge minor |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at c5552d5. Thanks a lot for contributing to OCA. ❤️ |
Context:
If a user explicitly cancels a job, he expects its child jobs to be canceled as well;
However if a job fails, child jobs will stay in WAIT_DEPENDENCIES state; an action is expected from user to fix it and job might succeed after being re-queued
Note
FIX
commit, it was fixed already as part of migration to 16.0+ (here)