From 992e131b5f7e3f938eba01a5e7f874710cc4b8ab Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 12 Dec 2019 23:01:51 +1300 Subject: [PATCH] squash all exceptions when cancelling the task in SingleInstanceTask otherwise restarting a failed task just raises the exception from the previous failure --- subiquitycore/async_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subiquitycore/async_helpers.py b/subiquitycore/async_helpers.py index 604e912e..dffe3a1f 100644 --- a/subiquitycore/async_helpers.py +++ b/subiquitycore/async_helpers.py @@ -50,7 +50,7 @@ class SingleInstanceTask: self.task.cancel() try: await self.task - except asyncio.CancelledError: + except BaseException: pass self.task = schedule_task(self.func(*args, **kw))