1
0

taskgroups: don't log CancelledError

This commit is contained in:
SomberNight
2020-02-27 20:22:49 +01:00
parent 15e91169c5
commit b21bcf5977
3 changed files with 18 additions and 6 deletions

View File

@@ -161,11 +161,16 @@ class LNWorker(Logger):
@ignore_exceptions # don't kill outer taskgroup
async def main_loop(self):
self.logger.info("starting taskgroup.")
try:
async with self.taskgroup as group:
await group.spawn(self._maintain_connectivity())
except asyncio.CancelledError:
raise
except Exception as e:
self.logger.exception("taskgroup died.")
finally:
self.logger.info("taskgroup stopped.")
async def _maintain_connectivity(self):
while True: