From a92f6be1a820c13502e75ad311f189ba7e0f87c9 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Wed, 20 Apr 2022 23:25:28 +0200 Subject: [PATCH] Make the mnt task more resilitent to errors --- twitch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/twitch.py b/twitch.py index 78103e8..9a33d00 100644 --- a/twitch.py +++ b/twitch.py @@ -479,7 +479,12 @@ class Twitch: channel = self.watching_channel.get_with_default(None) # ensure every ~20-30 minutes that we don't have unclaimed points bonus if channel is not None: - await channel.claim_bonus() + try: + await channel.claim_bonus() + except asyncio.CancelledError: + raise # let this one through + except Exception: + pass # we intentionally silently skip anything else await asyncio.sleep(period.total_seconds()) # this triggers this task restart every 60 minutes self.change_state(State.INVENTORY_FETCH)