mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Make the heartbeat normal thread to the daemon thread. #5567
This commit is contained in:
parent
a7cf698d09
commit
7dc0c1d05c
@ -57,6 +57,7 @@ class ServerHeartbeatTimer():
|
||||
self.t.start()
|
||||
self.release_server_heartbeat()
|
||||
self.t = threading.Timer(sec, func_wrapper)
|
||||
self.t.daemon = True
|
||||
self.t.start()
|
||||
self._app = _app
|
||||
|
||||
@ -87,15 +88,18 @@ class ServerHeartbeatTimer():
|
||||
@staticmethod
|
||||
def _release_connections(server_conn, sess_id, sid):
|
||||
for d in server_conn:
|
||||
# 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))
|
||||
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))
|
||||
except Exception as e:
|
||||
current_app.logger.exception(e)
|
||||
|
||||
def cancel(self):
|
||||
self.t.cancel()
|
||||
|
Loading…
Reference in New Issue
Block a user