Update ssh_terminal.py

pull/350/head
midoks 2 years ago
parent 515d25648f
commit ea03373363
  1. 22
      class/core/ssh_terminal.py

@ -55,9 +55,10 @@ class ssh_terminal:
__ssh_list = {} __ssh_list = {}
def __init__(self): def __init__(self):
ht = threading.Thread(target=self.heartbeat) # ht = threading.Thread(target=self.heartbeat)
ht.start() # ht.start()
ht.join() # ht.join()
pass
def debug(self, msg): def debug(self, msg):
msg = "{} - {}:{} => {} \n".format(mw.formatDate(), msg = "{} - {}:{} => {} \n".format(mw.formatDate(),
@ -379,17 +380,14 @@ class ssh_terminal:
def heartbeat(self): def heartbeat(self):
while True: while True:
time.sleep(1) time.sleep(3)
print("heartbeat:__ssh_list:", len(self.__ssh_list)) print("heartbeat:__ssh_list:", len(self.__ssh_list))
if self.__tp and self.__tp.is_active(): # self.debug("heartbeat:__ssh_list:" + str(len(self.__ssh_list)))
self.__tp.send_ignore() # if self.__tp and self.__tp.is_active():
else: # self.__tp.send_ignore()
break
if self.__ps and self.__ps.is_active(): # if self.__ps and self.__ps.is_active():
self.__ps.send_ignore() # self.__ps.send_ignore()
else:
break
def wsSend(self, recv): def wsSend(self, recv):
try: try:

Loading…
Cancel
Save