Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# config/initializers/counter_cache.rb
require 'cc_worker'
require 'redis'
Counter::Cache.configure do |c|
c.default_worker_adapter = CCWorker
c.recalculation_delay = (ENV['CC_RECALCULATION_DELAY_HOURS'] || '5').to_f.hours
c.redis_pool = $redis
c.counting_data_store = Counter::Cache::Redis.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment