Commit d6f53684 authored by Jonne Haß's avatar Jonne Haß
Browse files

Handle already deleted photos gracefully in process photo job

parent 499ff6e0
......@@ -16,6 +16,7 @@ module Workers
photo.processed_image.store!(unprocessed_image)
photo.save!
rescue ActiveRecord::RecordNotFound # Deleted before the job was run
end
end
end
......@@ -61,6 +61,12 @@ describe Workers::ProcessPhoto do
expect{
result = Workers::ProcessPhoto.new.perform(p.id)
}.to_not raise_error
end
it 'handles already deleted photos gracefully' do
expect {
Workers::ProcessPhoto.new.perform(0)
}.to_not raise_error
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment