more pings

This commit is contained in:
j 2016-02-14 11:23:55 +05:30
parent d602191557
commit 9468d90714

View file

@ -47,10 +47,10 @@ class Node(Thread):
self._q = Queue()
Thread.__init__(self)
self.daemon = True
self.ping()
self.start()
def run(self):
self.ping()
while not state.shutdown:
action = self._q.get()
if state.shutdown:
@ -470,8 +470,7 @@ class Nodes(Thread):
with db.session():
self._nodes[user_id] = Node(self, User.get_or_create(user_id))
else:
if not self._nodes[user_id].online:
self._nodes[user_id].ping()
self._nodes[user_id].ping()
if send_response:
self._nodes[user_id].send_response()