Skip to content
Snippets Groups Projects
Commit ed5114f6 authored by inso's avatar inso
Browse files

Forgot old nodes more regurarly

parent 3b9326c0
No related branches found
No related tags found
No related merge requests found
......@@ -147,11 +147,8 @@ class NetworkService(QObject):
asyncio.ensure_future(self.discovery_loop())
self.refresh_once()
while self.continue_crawling():
for connector in self._connectors:
if self.continue_crawling():
await connector.init_session()
connector.refresh()
if not first_loop:
for connector in self._connectors:
if connector.node.state in (Node.OFFLINE, Node.CORRUPTED) \
and connector.node.last_state_change + 3600 < time.time():
connector.disconnect()
......@@ -159,6 +156,11 @@ class NetworkService(QObject):
self._connectors.remove(connector)
self.node_removed.emit(connector.node)
for connector in self._connectors:
if self.continue_crawling():
await connector.init_session()
connector.refresh()
if not first_loop:
await asyncio.sleep(15)
first_loop = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment