-
-
Notifications
You must be signed in to change notification settings - Fork 39.7k
Closed
Description
Bug Description
When updating a cron job's schedule expression via cron.update, the nextRunAtMs timestamp is not recalculated. The old stale timestamp remains in jobs.json, causing the scheduler to skip runs until the old timestamp is reached.
Steps to Reproduce
- Create a cron job with schedule
0 */1 * * *(every hour) - Let it run at 10:00
- Update the schedule to
0 */2 * * *(every 2 hours) - Observe that
nextRunAtMsstill points to 11:00 instead of 12:00 - The job runs at 11:00 (wrong) then jumps to 13:00
Expected Behavior
When the schedule expression is updated, nextRunAtMs should be recalculated based on the new schedule.
Actual Behavior
nextRunAtMs retains the old value. The scheduler only recalculates after a job runs.
Workaround
Restart the gateway (openclaw gateway restart) — this forces full recalculation of all job timestamps.
Environment
- OpenClaw version: latest (npm)
- Node: v25.5.0
- OS: Ubuntu Linux
Impact
Missed cron runs when schedules are updated. In our case, 5 hourly writer runs and 2 publisher runs were skipped over ~6 hours.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels