Skip to content

Commit

Permalink
add :multithread => true to the Rails.cache calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Mar 8, 2011
1 parent aefc294 commit e4ec0f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions settings/app/models/refinery_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def per_page
end

def ensure_cache_exists!
if (result = Rails.cache.read(cache_key)).nil?
if (result = Rails.cache.read(cache_key, :multithread => true)).nil?
result = rewrite_cache
end

Expand Down Expand Up @@ -63,13 +63,13 @@ def to_cache(settings)

def rewrite_cache
# delete cache
Rails.cache.delete(cache_key)
Rails.cache.delete(cache_key, :multithread => true)

# generate new cache
result = (to_cache(all) if (table_exists? rescue false))

# write cache
Rails.cache.write(cache_key, result)
Rails.cache.write(cache_key, result, :multithread => true)

# return cache, or lack thereof.
result ||= []
Expand Down

0 comments on commit e4ec0f5

Please sign in to comment.