用户报:UI 上点"启用"/"停用"开关,看起来 toggle 切换了,但实际调度行为未变(或反之)。 需要从 UI 一直追到 scheduler,确认 PATCH 是否真正影响下一次 cron 触发。
PATCH /api/v1/schedules/{id}
schedules.enabled
common/db/models/schedules.py:38
apscheduler_jobs
schedule/scheduler.py
_sync_once
enabled=0
run_schedule_now
idx_schedules_workspace
backend/schedules.py PATCH 路由 / common/db/models/schedules.py:38 / schedule/scheduler.py _sync_once / frontend/app/features/schedules/SchedulePage.tsx
backend/schedules.py
frontend/app/features/schedules/SchedulePage.tsx
Task: g61h7g20zwcggp14hxszytw0
No dependencies set.
The note is not visible to the blocked user.
背景
用户报:UI 上点"启用"/"停用"开关,看起来 toggle 切换了,但实际调度行为未变(或反之)。
需要从 UI 一直追到 scheduler,确认 PATCH 是否真正影响下一次 cron 触发。
排查路径
PATCH /api/v1/schedules/{id}200?schedules.enabled字段是否按预期翻转(common/db/models/schedules.py:38定义)apscheduler_jobs表里该 schedule 的 job 状态schedule/scheduler.py_sync_once是否会读enabled=0后 pause_job已知干扰项
run_schedule_now不校验 enabled,可能误导"停用"测试——若 toggle 后还能手动跑,需独立区分idx_schedules_workspace索引里 enabled 是第二列,query 走全表扫描的可能验收
引用
backend/schedules.pyPATCH 路由 /common/db/models/schedules.py:38/schedule/scheduler.py_sync_once /frontend/app/features/schedules/SchedulePage.tsxTask: g61h7g20zwcggp14hxszytw0