mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🚨 auto fix by pre-commit hooks
This commit is contained in:
parent
b1ad116131
commit
07279a4b86
@ -86,7 +86,7 @@ async def _execute_single_job_instance(schedule: ScheduledJob, bot):
|
|||||||
params_model, BaseModel
|
params_model, BaseModel
|
||||||
):
|
):
|
||||||
params_instance = parse_as(params_model, context.job_kwargs)
|
params_instance = parse_as(params_model, context.job_kwargs)
|
||||||
injected_params["params"] = params_instance # type: ignore
|
injected_params["params"] = params_instance # type: ignore
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"任务 {schedule.id} (目标: {group_id}) 参数验证失败: {e}", e=e
|
f"任务 {schedule.id} (目标: {group_id}) 参数验证失败: {e}", e=e
|
||||||
@ -94,7 +94,7 @@ async def _execute_single_job_instance(schedule: ScheduledJob, bot):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
async def wrapper(bot: Bot):
|
async def wrapper(bot: Bot):
|
||||||
return await task_meta["func"](bot=bot, **injected_params) # type: ignore
|
return await task_meta["func"](bot=bot, **injected_params) # type: ignore
|
||||||
|
|
||||||
dependent = Dependent.parse(
|
dependent = Dependent.parse(
|
||||||
call=wrapper,
|
call=wrapper,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class BaseTrigger(BaseModel):
|
|||||||
class CronTrigger(BaseTrigger):
|
class CronTrigger(BaseTrigger):
|
||||||
"""Cron 触发器配置"""
|
"""Cron 触发器配置"""
|
||||||
|
|
||||||
trigger_type: Literal["cron"] = "cron" # type: ignore
|
trigger_type: Literal["cron"] = "cron" # type: ignore
|
||||||
year: int | str | None = None
|
year: int | str | None = None
|
||||||
month: int | str | None = None
|
month: int | str | None = None
|
||||||
day: int | str | None = None
|
day: int | str | None = None
|
||||||
@ -31,7 +31,7 @@ class CronTrigger(BaseTrigger):
|
|||||||
class IntervalTrigger(BaseTrigger):
|
class IntervalTrigger(BaseTrigger):
|
||||||
"""Interval 触发器配置"""
|
"""Interval 触发器配置"""
|
||||||
|
|
||||||
trigger_type: Literal["interval"] = "interval" # type: ignore
|
trigger_type: Literal["interval"] = "interval" # type: ignore
|
||||||
weeks: int = 0
|
weeks: int = 0
|
||||||
days: int = 0
|
days: int = 0
|
||||||
hours: int = 0
|
hours: int = 0
|
||||||
@ -46,7 +46,7 @@ class IntervalTrigger(BaseTrigger):
|
|||||||
class DateTrigger(BaseTrigger):
|
class DateTrigger(BaseTrigger):
|
||||||
"""Date 触发器配置"""
|
"""Date 触发器配置"""
|
||||||
|
|
||||||
trigger_type: Literal["date"] = "date" # type: ignore
|
trigger_type: Literal["date"] = "date" # type: ignore
|
||||||
run_date: datetime | str
|
run_date: datetime | str
|
||||||
timezone: str | None = None
|
timezone: str | None = None
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user