FIX: Be more aggressive in checking master when trying to fallback.

This commit is contained in:
Guo Xiang Tan
2018-06-12 00:08:47 +08:00
parent 4d75535f9e
commit 2adae2a0b6
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class PostgreSQLFallbackHandler
thread = Thread.new { initiate_fallback_to_master } thread = Thread.new { initiate_fallback_to_master }
thread.join thread.join
break if synchronize { @masters_down.hash.empty? } break if synchronize { @masters_down.hash.empty? }
sleep 10 sleep 5
end end
end end

View File

@ -27,7 +27,7 @@ class DiscourseRedis
thread = Thread.new { initiate_fallback_to_master } thread = Thread.new { initiate_fallback_to_master }
thread.join thread.join
break if synchronize { @master } break if synchronize { @master }
sleep 10 sleep 5
ensure ensure
thread.kill thread.kill
end end