Fix broken condition in PostgresqlFallbackAdapter.

This commit is contained in:
Guo Xiang Tan
2017-09-15 16:40:04 +08:00
parent e542884b00
commit 9540b952fd
2 changed files with 27 additions and 3 deletions

View File

@ -119,7 +119,14 @@ module ActiveRecord
def verify_replica(connection)
value = connection.raw_connection.exec("SELECT pg_is_in_recovery()").values[0][0]
raise "Replica database server is not in recovery mode." if value == 'f'
if !value
begin
raise "Replica database server is not in recovery mode."
ensure
connection.close
end
end
end
end
end