Skip to content

Instantly share code, notes, and snippets.

@brunomichetti
Created August 27, 2019 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunomichetti/418b65760974596505cbcc1c94575841 to your computer and use it in GitHub Desktop.
Save brunomichetti/418b65760974596505cbcc1c94575841 to your computer and use it in GitHub Desktop.
# 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