Skip to content

fix(cron): use job.id instead of job.name for API calls#58

Merged
1186258278 merged 1 commit intoqingchencloud:mainfrom
axdlee:fix-cron-run-id
Mar 13, 2026
Merged

fix(cron): use job.id instead of job.name for API calls#58
1186258278 merged 1 commit intoqingchencloud:mainfrom
axdlee:fix-cron-run-id

Conversation

@axdlee
Copy link
Copy Markdown
Contributor

@axdlee axdlee commented Mar 13, 2026

Bug Description

The cron job trigger button was passing job name instead of job id to the cron.run API, causing 'unknown cron job id' errors when jobs have custom names.

Root Cause

In fetchJobs(), the job object was constructed with:

id: j.name || j.id  // Wrong: uses name when available

This caused the trigger button to pass name (e.g., "工作日订餐提醒") instead of id to cron.run.

Fix

  1. Changed id: j.name || j.id to id: j.id
  2. Added .filter(j => j.id) for defensive programming

Changes

  • src/pages/cron.js: Fixed job ID assignment

The cron job trigger button was passing job name instead of job id
to the cron.run API, causing 'unknown cron job id' errors when
jobs have custom names.

Fixes: qingchencloud#1
@1186258278 1186258278 merged commit e5b9677 into qingchencloud:main Mar 13, 2026
@1186258278
Copy link
Copy Markdown
Contributor

感谢 @axdlee 的贡献!🎉 这个修复很精准 — j.name || j.id 在有自定义名称时确实会导致 cron.run 传错参数。已 squash 合并到 main。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants