feat: 只保留管理入口,缓存小区信息表解析,连接中显示提示,移除脚本管理打包方式
This commit is contained in:
+3
-2
@@ -8,8 +8,6 @@ from dataclasses import asdict, dataclass, field, fields, replace
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from apscheduler.triggers.cron import CronTrigger
|
||||
|
||||
import main
|
||||
|
||||
TIMEZONE = os.getenv("TZ") or "Asia/Shanghai"
|
||||
@@ -122,6 +120,9 @@ def validate(data: dict[str, Any], current: Settings) -> Settings:
|
||||
}
|
||||
settings = Settings(**values)
|
||||
if settings.schedule_mode == "cron":
|
||||
# Imported here so the worker process, which only reads saved settings, does not load the scheduler.
|
||||
from apscheduler.triggers.cron import CronTrigger
|
||||
|
||||
try:
|
||||
CronTrigger.from_crontab(settings.cron_expression, timezone=TIMEZONE)
|
||||
except ValueError as exc:
|
||||
|
||||
Reference in New Issue
Block a user