In certain cases, caches are deleted by other thread at same time, just log it.
This commit is contained in:
parent
d2573d0654
commit
f6a9144086
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue