From b25fcd9ac292f58344e1b22d3d3e52694f990f00 Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Fri, 13 Sep 2024 01:07:34 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E5=B0=9D=E8=AF=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E7=A7=8D=E5=8F=AF=E4=BB=A5=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E8=AF=B7=E6=B1=82=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_bison/scheduler/scheduler.py | 3 +++ nonebot_bison/utils/site.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/nonebot_bison/scheduler/scheduler.py b/nonebot_bison/scheduler/scheduler.py index cf36a31..f94ea87 100644 --- a/nonebot_bison/scheduler/scheduler.py +++ b/nonebot_bison/scheduler/scheduler.py @@ -12,6 +12,7 @@ from ..send import send_msgs from ..types import Target, SubUnit from ..platform import platform_manager from ..utils import Site, ProcessContext +from ..utils.site import SkipRequestException @dataclass @@ -107,6 +108,8 @@ class Scheduler: schedulable.platform_name, schedulable.target ) to_send = await platform_obj.do_fetch_new_post(SubUnit(schedulable.target, send_userinfo_list)) + except SkipRequestException as err: + logger.debug(f"skip request: {err}") except Exception as err: records = context.gen_req_records() for record in records: diff --git a/nonebot_bison/utils/site.py b/nonebot_bison/utils/site.py index e39d1e9..4519f7c 100644 --- a/nonebot_bison/utils/site.py +++ b/nonebot_bison/utils/site.py @@ -173,3 +173,7 @@ def anonymous_site(schedule_type: Literal["date", "interval", "cron"], schedule_ "client_mgr": DefaultClientManager, }, ) + + +class SkipRequestException(Exception): + pass