From 7b04d81074cda563d0b42d8e86f90dafd634a874 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:38:37 +0000 Subject: [PATCH] :rotating_light: auto fix by pre-commit hooks --- zhenxun/builtin_plugins/scheduler_admin/__init__.py | 4 ++-- zhenxun/models/scheduled_job.py | 2 +- zhenxun/services/scheduler/manager.py | 4 +--- zhenxun/services/scheduler/types.py | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/zhenxun/builtin_plugins/scheduler_admin/__init__.py b/zhenxun/builtin_plugins/scheduler_admin/__init__.py index 47d01822..989aa75c 100644 --- a/zhenxun/builtin_plugins/scheduler_admin/__init__.py +++ b/zhenxun/builtin_plugins/scheduler_admin/__init__.py @@ -120,5 +120,5 @@ __plugin_meta__ = PluginMetadata( type=int, ), ], - ).to_dict(), - ) + ).to_dict(), +) diff --git a/zhenxun/models/scheduled_job.py b/zhenxun/models/scheduled_job.py index 6ae0de60..564d4944 100644 --- a/zhenxun/models/scheduled_job.py +++ b/zhenxun/models/scheduled_job.py @@ -47,7 +47,7 @@ class ScheduledJob(Model): execution_options = fields.JSONField( null=True, description="任务执行的额外选项 (例如: jitter, spread, " - "interval, concurrency_policy)", + "interval, concurrency_policy)", ) create_time = fields.DatetimeField(auto_now_add=True) diff --git a/zhenxun/services/scheduler/manager.py b/zhenxun/services/scheduler/manager.py index 07369713..103e4845 100644 --- a/zhenxun/services/scheduler/manager.py +++ b/zhenxun/services/scheduler/manager.py @@ -472,9 +472,7 @@ class SchedulerManager: "required_permission": required_permission, "source": source, "is_one_off": is_one_off, - "execution_options": model_dump( - validated_options, exclude_none=True - ), + "execution_options": model_dump(validated_options, exclude_none=True), } defaults = {k: v for k, v in defaults.items() if v is not None} diff --git a/zhenxun/services/scheduler/types.py b/zhenxun/services/scheduler/types.py index 236770c9..c05bcf79 100644 --- a/zhenxun/services/scheduler/types.py +++ b/zhenxun/services/scheduler/types.py @@ -77,6 +77,7 @@ class Trigger: """创建一个 Date 触发器配置。""" return DateTrigger(**kwargs) + class ExecutionOptions(BaseModel): """ 封装定时任务的执行策略,包括重试和回调。