From 6ae4e68d1ccc1911bcdffbdc77a587c878f4cb30 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 11 Jan 2019 14:25:53 -0500 Subject: [PATCH] looping_call shouldnt need to mess with cancellation --- lbrynet/extras/daemon/storage.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lbrynet/extras/daemon/storage.py b/lbrynet/extras/daemon/storage.py index dbef7e754..883b8b367 100644 --- a/lbrynet/extras/daemon/storage.py +++ b/lbrynet/extras/daemon/storage.py @@ -51,16 +51,12 @@ async def open_file_for_writing(download_directory: str, suggested_file_name: st async def looping_call(interval, fun): - try: - while True: - try: - await fun() - except Exception as e: - log.exception('Looping call experienced exception:', exc_info=e) - await asyncio.sleep(interval) - except asyncio.CancelledError: - pass - + while True: + try: + await fun() + except Exception as e: + log.exception('Looping call experienced exception:', exc_info=e) + await asyncio.sleep(interval) class SQLiteStorage(SQLiteMixin):