Skip to content
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

uow: add "on_exception" lifecycle hook #176

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

slint
Copy link
Member

@slint slint commented Oct 30, 2024

  • When an exception occurs and the unit of work is being rolled back, we
    want to add the possibility to perform some clean-up actions that can
    also be commited to the database.
  • The new on_exception method is added because we want to keep
    backwards compatibility and also introduce the same "triplet" of
    methods as we have for the "happy path" (on_register, on_commit,
    on_post_commit).
  • Closes Redesign content moderation component for extensibility invenio-rdm-records#1861

invenio_db/uow.py Outdated Show resolved Hide resolved
- When an exception occurs and the unit of work is being rolled back, we
  want to add the possibility to perform some clean-up actions that can
  also be commited to the database.
- The new `on_exception` method is added because we want to keep
  backwards compatibility and also introduce the same "triplet" of
  methods as we have for the "happy path" (`on_register`, `on_commit`,
  `on_post_commit`).
@slint slint merged commit fdfd618 into inveniosoftware:master Nov 4, 2024
8 checks passed
@slint slint deleted the 1861-uow-exception branch November 4, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redesign content moderation component for extensibility
3 participants