Make the mnt task more resilitent to errors

This commit is contained in:
DevilXD committed 2022-04-20 23:25:28 +02:00
1 parent 0e3478dec9
commit a92f6be1a8
1 file changed
+5
+5
View File
@@ -479,7 +479,12 @@ class Twitch:
channel = self.watching_channel.get_with_default(None) channel = self.watching_channel.get_with_default(None)
# ensure every ~20-30 minutes that we don't have unclaimed points bonus # ensure every ~20-30 minutes that we don't have unclaimed points bonus
if channel is not None: if channel is not None:
try:
await channel.claim_bonus() 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()) await asyncio.sleep(period.total_seconds())
# this triggers this task restart every 60 minutes # this triggers this task restart every 60 minutes
self.change_state(State.INVENTORY_FETCH) self.change_state(State.INVENTORY_FETCH)