-
-
Notifications
You must be signed in to change notification settings - Fork 584
[19.0][IMP] queue_job: Implement on fail hook #955
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
base: 19.0
Are you sure you want to change the base?
Changes from all commits
0a6297f
d2e54c2
ced3840
ea4db16
62b1b15
37f397e
968d0c9
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 |
|---|---|---|
|
|
@@ -77,6 +77,7 @@ class QueueJob(models.Model): | |
|
|
||
| model_name = fields.Char(string="Model", readonly=True) | ||
| method_name = fields.Char(readonly=True) | ||
| on_fail_method_name = fields.Char(readonly=True) | ||
|
Member
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 would appreciate consistency in naming: on_fail_hook + on_fail_method + on_fail_method_name is going to make some greps miss.
Author
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. Hello @amh-mw What would you suggest? As I take naming quite seriously, here was my rationale:
Member
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 might rename all of them (plus In honor of this pull request, I'm going to rename
Contributor
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.
|
||
| records = JobSerialized( | ||
| string="Record(s)", | ||
| readonly=True, | ||
|
|
@@ -490,3 +491,6 @@ def _test_job( | |
| time.sleep(job_duration) | ||
| if commit_within_job: | ||
| self.env.cr.commit() # pylint: disable=invalid-commit | ||
|
|
||
| def _test_on_fail_hook(self, **kw): | ||
|
Contributor
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. If only for testing,this is not needed
Author
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 get |
||
| pass | ||
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.
shall we pass the exception obj too?
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.
Is there any added value to pass the raw exception instead of what's been extracted from it in
_get_failure_values❓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.
yes, you can inspect the exception for additional info. Not a must have tho.