尝试添加一种可以跳过当前请求的方式

This commit is contained in:
suyiiyii 2024-09-13 01:07:34 +08:00
parent 16331b50d5
commit b25fcd9ac2
2 changed files with 7 additions and 0 deletions

View File

@ -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:

View File

@ -173,3 +173,7 @@ def anonymous_site(schedule_type: Literal["date", "interval", "cron"], schedule_
"client_mgr": DefaultClientManager,
},
)
class SkipRequestException(Exception):
pass