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

[#7934] Fix missing ActiveStorage attachment uploads #7953

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/jobs/foi_attachment_mask_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def mask
end

attachment.update(body: body, masked_at: Time.zone.now)

# ensure the after_commit callback runs which uploads the blob, without this
# the callback might not execute in time and the job exits resulting in the
# lost of the masked attachment body.
return if attachment.file_blob.service.exist?(attachment.file_blob.key)

attachment.run_callbacks(:commit)
end

def masks
Expand Down
Loading