From 14529737ee7fba87144ab9917364c7155b0fdd7f Mon Sep 17 00:00:00 2001 From: JamzumSum Date: Fri, 1 Dec 2023 17:07:26 +0800 Subject: [PATCH] fix: clear last_fail_cause when hb success --- pyproject.toml | 2 +- src/qzone3tg/app/base/_hook.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5efae36..f1b81e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Qzone3TG" -version = "0.9.6.dev4" +version = "0.9.6.dev5" description = "Forward Qzone feeds to telegram." authors = ["aioqzone "] readme = "README.md" diff --git a/src/qzone3tg/app/base/_hook.py b/src/qzone3tg/app/base/_hook.py index 578dc6a..713d7bd 100644 --- a/src/qzone3tg/app/base/_hook.py +++ b/src/qzone3tg/app/base/_hook.py @@ -138,3 +138,8 @@ async def HeartbeatRefresh(num: int): self.log.info("当前正在爬取,心跳刷新已忽略。") return self.ch_fetch.add_awaitable(self._fetch(self.conf.bot.admin, is_period=True)) + + @self.qzone.hb_refresh.add_impl + def clear_last_fail_cause(num: int): + nonlocal last_fail_cause + last_fail_cause = None