Add connection_lost. Properly handle shutdown of watch_q.
This commit is contained in:
parent
4b4c312fbe
commit
f38a796181
@ -61,7 +61,7 @@ def main():
|
|||||||
database.close()
|
database.close()
|
||||||
watch_q_task.cancel()
|
watch_q_task.cancel()
|
||||||
loop.run_until_complete(node.shutdown())
|
loop.run_until_complete(node.shutdown())
|
||||||
loop.run_until_complete(watch_q_task)
|
loop.run_until_complete(asyncio.wait([watch_q_task]))
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -62,6 +62,9 @@ class SybilNode:
|
|||||||
self._tasks.append(self._loop.create_task(self.increase_neighbour_task()))
|
self._tasks.append(self._loop.create_task(self.increase_neighbour_task()))
|
||||||
self._transport = transport
|
self._transport = transport
|
||||||
|
|
||||||
|
def connection_lost(self, exc):
|
||||||
|
self._is_paused = True
|
||||||
|
|
||||||
def pause_writing(self):
|
def pause_writing(self):
|
||||||
self._is_paused = True
|
self._is_paused = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user