-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Provide environment information
n/a
Describe the bug
Schedules created imperatively via schedules.create() don't appear in the Schedules tab when there is no current successful deployment for that environment. They still count against the schedule limit and keep firing runs, but there is no way to view or delete them from the dashboard. This creates a deadlock: the schedules block deployment, and the failed deployment hides the schedules.
Reproduction repo
n/a
To reproduce
- Create 10 scheduled tasks and deploy successfully (declarative schedules are auto-created on deploy)
- Remove all 10 tasks from code and redeploym, schedules are cleared
- Imperatively create 10 schedules via
schedules.create()using a unique deduplicationKey each time (simulating CI runs without a stable key):
await schedules.create({
task: "scheduled-task-1",
cron: "* * * * *",
deduplicationKey: `ci-run-${Date.now()}`,
});
// repeat for 10 tasks
- Go to the Schedules tab → shows 0 schedules despite 10 existing in the DB
- Try to deploy the 10 scheduled tasks again → fails with You have created 10/10 schedules
Additional information
Workaround: Use a stable deduplicationKey in CI so repeated runs upsert instead of creating new schedules. If you're already over the limit, you can clean up with a loop: call schedules.list() and then schedules.del() for each returned schedule (e.g. from a one-off script or task).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels