In certain cases, caches are deleted by other thread at same time, just log it.

This commit is contained in:
Martin Edenhofer 2016-06-15 10:53:01 +02:00
parent d2573d0654
commit f6a9144086

View file

@ -28,7 +28,14 @@ write a cache
if !params[:expires_in]
params[:expires_in] = 7.days
end
Rails.cache.write(key.to_s, data, params)
# in certain cases, caches are deleted by other thread at same
# time, just log it
begin
Rails.cache.write(key.to_s, data, params)
rescue => e
Rails.logger.error "Can't write cache #{key}: #{e.inspect}"
end
end
=begin