# Redis configuration # Development/test: localhost:6379 (default) # Production: set REDIS_URL env variable, e.g. redis://redis.example.com:6379/0 # Use an isolated Redis logical database in tests to avoid clobbering dev data. url = ENV.fetch("REDIS_URL", "redis://localhost:6380/0") url = url.sub(%r{/\d+$}, "/15") if Rails.env.test? RedisConnection = ConnectionPool.new(size: 5, timeout: 5) do Redis.new(url: url) end