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