perf(douyu): 优化慢查询并修复供应商充值收口
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
自动化按「渐进上线」推进,因此:
|
||||
|
||||
- 调度器总开关 ``AUTOMATION_ENABLED`` **默认关闭**;
|
||||
- 每个作业自己还有开关,**默认关闭**,在 ``/automation`` 页面打开;
|
||||
- 每个作业自己还有开关,**默认关闭**;少数维护型作业可通过
|
||||
``JobSpec.default_enabled`` 在首次建行时默认启用,之后仍完全尊重页面配置;
|
||||
- 作业状态全部落库(``automation_jobs`` / ``automation_runs``),进程重启不丢
|
||||
调度进度,也不会因为重启而重复跑一轮。
|
||||
|
||||
@@ -65,6 +66,8 @@ class JobSpec:
|
||||
#: **多久跑一次**(调度频率)。默认 5 分钟,与改动前的实际行为一致。
|
||||
#: ⚠️ 必须放在**有默认值**的位置(dataclass 不允许默认值字段排在无默认值之前)。
|
||||
run_interval_seconds: int = 300
|
||||
#: 新库首次创建作业行时是否默认启用。已有行永远尊重运维配置。
|
||||
default_enabled: bool = False
|
||||
|
||||
|
||||
_REGISTRY: dict[str, JobSpec] = {}
|
||||
@@ -120,7 +123,7 @@ def ensure_jobs(db: Session) -> None:
|
||||
AutomationJob(
|
||||
key=spec.key,
|
||||
title=spec.title,
|
||||
enabled=False,
|
||||
enabled=spec.default_enabled,
|
||||
interval_seconds=spec.interval_seconds,
|
||||
run_interval_seconds=spec.run_interval_seconds,
|
||||
batch_size=spec.batch_size,
|
||||
|
||||
Reference in New Issue
Block a user