mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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.t.start()
|
||||||
self.release_server_heartbeat()
|
self.release_server_heartbeat()
|
||||||
self.t = threading.Timer(sec, func_wrapper)
|
self.t = threading.Timer(sec, func_wrapper)
|
||||||
|
self.t.daemon = True
|
||||||
self.t.start()
|
self.t.start()
|
||||||
self._app = _app
|
self._app = _app
|
||||||
|
|
||||||
@ -87,6 +88,7 @@ class ServerHeartbeatTimer():
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _release_connections(server_conn, sess_id, sid):
|
def _release_connections(server_conn, sess_id, sid):
|
||||||
for d in server_conn:
|
for d in server_conn:
|
||||||
|
try:
|
||||||
# Release the connection
|
# Release the connection
|
||||||
server_conn[d]._release()
|
server_conn[d]._release()
|
||||||
# Reconnect on the reload
|
# Reconnect on the reload
|
||||||
@ -96,6 +98,8 @@ class ServerHeartbeatTimer():
|
|||||||
"connection for the session "
|
"connection for the session "
|
||||||
"id##server id: {0}##{1}".format(
|
"id##server id: {0}##{1}".format(
|
||||||
sess_id, sid))
|
sess_id, sid))
|
||||||
|
except Exception as e:
|
||||||
|
current_app.logger.exception(e)
|
||||||
|
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
self.t.cancel()
|
self.t.cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user