mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
While restoring the database connections due to lost server connection, ensure that the databases which were previously connected are only reconnected. #5919
This commit is contained in:
parent
5cb64f7602
commit
f1aa82ad36
@ -111,15 +111,16 @@ class ServerHeartbeatTimer():
|
||||
def _release_connections(server_conn, sess_id, sid):
|
||||
for d in server_conn:
|
||||
try:
|
||||
# Release the connection
|
||||
server_conn[d]._release()
|
||||
# Reconnect on the reload
|
||||
server_conn[d].wasConnected = True
|
||||
current_app.logger.debug(
|
||||
"Heartbeat not received. Released "
|
||||
"connection for the session "
|
||||
"id##server id: {0}##{1}".format(
|
||||
sess_id, sid))
|
||||
# Release the connection only if it is connected
|
||||
if server_conn[d].wasConnected:
|
||||
server_conn[d]._release()
|
||||
# Reconnect on the reload
|
||||
server_conn[d].wasConnected = True
|
||||
current_app.logger.debug(
|
||||
"Heartbeat not received. Released "
|
||||
"connection for the session "
|
||||
"id##server id: {0}##{1}".format(
|
||||
sess_id, sid))
|
||||
except Exception as e:
|
||||
current_app.logger.exception(e)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user