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

fix(credit_note): Make sure credit notes jobs are processed outside of DB transactions #2680

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

Some CreditNotes::GeneratePdfJob have failed lately with the following error:

ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn't find CreditNote with 'id'=XXX

Description

This PR makes sure that all jobs related to credit notes are performed after any database transaction.

@nudded
Copy link
Contributor

nudded commented Oct 14, 2024

@vincent-pochet Sidekiq has a built-in middleware if the after_commit_everywhere gem is enabled: https://github.com/sidekiq/sidekiq/wiki/Advanced-Options#transactional-push

@vincent-pochet
Copy link
Collaborator Author

@vincent-pochet Sidekiq has a built-in middleware if the after_commit_everywhere gem is enabled: https://github.com/sidekiq/sidekiq/wiki/Advanced-Options#transactional-push

@nudded we have tried it in the past, without luck. It was not behaving as expecting for some reasons (To be honest I don't remember what was wrong with it)

@vincent-pochet vincent-pochet merged commit fa26a75 into main Oct 14, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the fix-credit-note-deserialize branch October 14, 2024 08:49
@vincent-pochet vincent-pochet changed the title fix(credit_note): Make sure after create jobs are processed outside of DB transactions fix(credit_note): Make sure credit notes jobs are processed outside of DB transactions Oct 14, 2024
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.

4 participants