Method: Stats#initialize
- Defined in:
- lib/stats.rb
#initialize(options) ⇒ Stats
Sets up redis usage for statistics
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/stats.rb', line 8 def initialize() [:redis_options] = {} unless .has_key? :redis_options if [:redis] @full_redis = [:redis] else @full_redis = Redis.new([:redis_options]) end @lock = Mutex.new @redis = Redis::Namespace.new("cobweb-#{Cobweb.version}-#{options[:crawl_id]}", :redis => @full_redis) end |