Commit e1c606a
authored
feat(scheduler): use go-cron FullParser for extended cron syntax (#438)
## Summary
Switch from custom parser configuration to `cron.FullParser()` which
enables all cron syntax variants:
- Standard 5-field cron expressions
- 6-field with optional seconds
- **Year field support** for one-time scheduling (addresses #344)
- **Extended syntax**: L (last), W (weekday), # (nth), #L (last
occurrence)
- Hash expressions for consistent random scheduling
- All cron descriptors (@Yearly, @every, etc.)
## Changes
- **core/scheduler.go**: Replace manual parser config with
`cron.FullParser()`
- **go.mod/go.sum**: Update go-cron dependency to v0.8.0
- **docs/QUICK_REFERENCE.md**: Add examples for year field and extended
syntax
## New Schedule Examples
```bash
# One-time scheduling with year field
30 14 25 12 * 2025 # Dec 25, 2025 at 14:30
# Extended syntax
0 12 L * * # Last day of every month at noon
0 12 * * FRI#3 # 3rd Friday of every month
0 12 * * FRI#L # Last Friday of every month
```
## Test plan
- [x] Existing tests pass (`make test`)
- [x] go-cron v0.8.0 includes comprehensive FullParser tests
- [ ] Manual verification of year field scheduling4 files changed
+15
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 76 | + | |
80 | 77 | | |
81 | 78 | | |
82 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
0 commit comments