-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Closed
Description
Summary
When updating a cron job after its daily scheduled time has passed, the nextRunAtMs is incorrectly set to 24 hours later than expected, causing the job to skip the next day's run.
Steps to Reproduce
- Create a cron job with schedule
25 6 * * *(6:25 AM daily) in timezoneAmerica/New_York - Update the job at 10:37 PM on Feb 6, 2026
- Observe
nextRunAtMsin the job state
Expected Behavior
nextRunAtMsshould be Feb 7, 2026 at 6:25 AM EST (~7.8 hours after update)
Actual Behavior
nextRunAtMsis Feb 8, 2026 at 6:25 AM EST (~31.8 hours after update)- The job skips Feb 7 entirely
Investigation
The croner library correctly calculates the next run:
const { Cron } = require('croner');
const updateTime = new Date('2026-02-06T22:37:00-05:00');
const cron = new Cron('25 6 * * *', { timezone: 'America/New_York' });
cron.nextRun(updateTime); // Returns Feb 7, 2026 6:25 AM EST ✓But the stored nextRunAtMs is exactly 86,400,000ms (24 hours) off. The bug appears to be in OpenClaw's update flow, not croner itself.
Environment
- OpenClaw: 2026.2.3-1 (d84eb46)
- Node.js: v25.5.0
- OS: macOS Darwin 24.6.0
Workaround
After updating a daily cron job, manually trigger it if nextRunAtMs seems too far in the future.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels