From 5bf56f7c0d1ec5ac2e5961a0fa3f77c8741d82a0 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Fri, 16 Dec 2022 08:44:33 +0100 Subject: [PATCH] Differentiate mnt task logging points claim vs reload --- twitch.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/twitch.py b/twitch.py index 730fdd6..bdaf7d7 100644 --- a/twitch.py +++ b/twitch.py @@ -1040,11 +1040,17 @@ class Twitch: trigger_cleanup = True self._mnt_triggers.popleft() next_trigger = switch_trigger + if next_trigger == next_period: + trigger_type: str = "Reload" + elif trigger_cleanup: + trigger_type = "Cleanup" + else: + trigger_type = "Points" logger.log( CALL, ( - f"Maintenance task waiting until: {next_trigger.astimezone().strftime('%X')} " - f"({'Cleanup' if trigger_cleanup else 'Reload'})" + "Maintenance task waiting until: " + f"{next_trigger.astimezone().strftime('%X')} ({trigger_type})" ) ) await asyncio.sleep((next_trigger - now).total_seconds()) @@ -1063,7 +1069,7 @@ class Twitch: except Exception: pass # we intentionally silently skip anything else # this triggers this task restart every (up to) 60 minutes - logger.log(CALL, "Maintenance task requests reload") + logger.log(CALL, "Maintenance task requests a reload") self.change_state(State.INVENTORY_FETCH) def can_watch(self, channel: Channel) -> bool: