BUGFIX: no network could mean no posts save.

This commit is contained in:
Sam Saffron 2014-06-16 12:14:51 +10:00
parent 944cda1f73
commit 03cde003db

View file

@ -30,6 +30,9 @@ class UserAvatar < ActiveRecord::Base
end
rescue OpenURI::HTTPError
save!
rescue SocketError
# skip saving, we are not connected to the net
Rails.logger.warn "Failed to download gravatar, socket error - user id #{ user.id }"
ensure
tempfile.unlink if tempfile
end