Skip to content

[19.0][IMP] queue_job: Implement on fail hook - #955

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-queue_job_on_fail_hook
Aug 27, 2026
Merged

[19.0][IMP] queue_job: Implement on fail hook#955
OCA-git-bot merged 1 commit into
OCA:19.0from
camptocamp:19.0-imp-queue_job_on_fail_hook

Conversation

@grindtildeath

Copy link
Copy Markdown

Allows to execute a model function when the job fails and will not be retried.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbidoul, @guewen,
some modules you are maintaining are being modified, check this out!

@simahawk

Copy link
Copy Markdown
Contributor

Just for the record, there were 2 other attempts to manage this

Your approach seem cleaner tho.

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

overall LGTM

Comment thread queue_job/controllers/main.py Outdated
Comment thread queue_job/models/queue_job.py Outdated

@florentx florentx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI fails on test_queue_job add-on.

@OCA-git-bot OCA-git-bot added the mod:test_queue_job Module test_queue_job label Jul 27, 2026
@simahawk

Copy link
Copy Markdown
Contributor

IMO the test failure is correct because it runs in a temporary env that is not rolled back.
You should mock in_temporary_env to use the same cursor.

@grindtildeath

Copy link
Copy Markdown
Author

@simahawk That is what I did, but it was still 🔴 because of the logger in the controller, explicitely muting it makes it 🟢

@guewen Can you please have a look? 🙏

Comment thread queue_job/models/queue_job.py Outdated
Comment thread queue_job/models/base.py Outdated
@grindtildeath
grindtildeath force-pushed the 19.0-imp-queue_job_on_fail_hook branch 2 times, most recently from 5b6143c to 6651362 Compare August 13, 2026 19:39

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ivantodorovich ivantodorovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LG but ci is red

Allows to execute a model function when the job fails and will
not be retried.

[REF] queue_job: Move on fail definition to job function

Rename on_fail_hook to on_fail
@simahawk
simahawk force-pushed the 19.0-imp-queue_job_on_fail_hook branch from 10aea19 to ad4d223 Compare August 27, 2026 12:44
@simahawk

Copy link
Copy Markdown
Contributor

Rebased and squashed. @guewen good for you?

@guewen

guewen commented Aug 27, 2026

Copy link
Copy Markdown
Member

/ocabot merge minor

Yes, thanks!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 19.0-ocabot-merge-pr-955-by-guewen-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 9e2d790 into OCA:19.0 Aug 27, 2026
7 of 8 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at bec45a9. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants