Skip to content

Commit

Permalink
fix(migration): skip presentations missing from active storage (#5796)
Browse files Browse the repository at this point in the history
fixes: #5767
  • Loading branch information
danimo authored May 3, 2024
1 parent 04c7288 commit 6069823
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/tasks/migrations/migrations.rake
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ namespace :migrations do
room_settings: room_settings,
shared_users_emails: shared_users_emails } }
if r.presentation.attached?
params[:room][:presentation] = { blob: Base64.encode64(r.presentation.blob.download),
filename: r.presentation.blob.filename.to_s }
begin
params[:room][:presentation] = { blob: Base64.encode64(r.presentation.blob.download),
filename: r.presentation.blob.filename.to_s }
rescue Errno::ENOENT
p "Failed to locate '#{r.presentation.blob.filename.to_s}' in active storage, skipping."
end
end

response = Net::HTTP.post(uri('rooms'), payload(params), COMMON[:headers])

case response
Expand Down

0 comments on commit 6069823

Please sign in to comment.