added setting to flush redis if you feel like doing so in dev

This commit is contained in:
Sam 2013-05-03 09:55:56 +10:00
parent 3ca263568e
commit 4d2c28e8b2
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@ require "#{Rails.root}/lib/discourse_redis"
$redis = DiscourseRedis.new
if Rails.env.development? && !ENV['DO_NOT_FLUSH_REDIS']
if Rails.env.development? && ENV['DISCOURSE_FLUSH_REDIS']
puts "Flushing redis (development mode)"
$redis.flushall
end

View file

@ -30,7 +30,7 @@ describe MessageBus::ReliablePubSub do
it 'gets every response from child processes' do
pid = nil
Redis.new(:db => 10).flushall
Redis.new(:db => 10).flushdb
begin
pids = (1..10).map{spawn_child}
responses = []