mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
Fix broken condition in PostgresqlFallbackAdapter.
This commit is contained in:
parent
e542884b00
commit
9540b952fd
2 changed files with 27 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue