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

Active storage transaction fix #1

Open
wants to merge 2 commits into
base: bump_rails_version
Choose a base branch
from

Conversation

caiofct
Copy link
Collaborator

@caiofct caiofct commented Sep 16, 2021

When using the config.active_job.queue_adapter = :inline ActiveStorage attachments were not ready to be downloaded from inside the same transaction that is not yet commited. See this issue: rails/rails#36994

So to fix this issue we now are generating all the files outside of the ProcessOrderJob transaction. This is not a problem when we use sidekiq as the queue backend because it will run in a background job outside of the original transaction.

…e sending them via email to avoid getting a ActiveStorage::FileNotFoundError dues to transactional nature of ActiveStorage on Rails 6.""

This reverts commit e76bdf7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant