nitro
nitro copied to clipboard
feat(tasks): one-time tasks
๐ Linked issue
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [x] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
๐ Checklist
- [x] I have linked an issue or discussion.
- [x] I have updated the documentation accordingly.
Implements scheduled one time tasks for #1974
Croner only ever runs on full seconds, so the actual wait time may be slightly after the specified time.
I added a test that runs a scheduled task. Sadly, I didn't find a way to use Vitest's mock timers to artificially advance the Cron job.