forked from robfig/cron
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
apiAPI design changesAPI design changesenhancementNew feature or requestNew feature or requestneeds-discussionRequires discussion or approval before implementationRequires discussion or approval before implementation
Description
Description
When multiple jobs are scheduled for the same time, there's no way to control execution order.
Current Behavior
Jobs scheduled for the same time execute in arbitrary order based on heap implementation.
Proposed Enhancement
// Priority option (higher = runs first)
c.AddFunc("@daily", highPriorityJob, cron.WithPriority(10))
c.AddFunc("@daily", lowPriorityJob, cron.WithPriority(1))
// Or dependency-based
c.AddFunc("@daily", jobB, cron.After(jobAID)) // See #192
// Or explicit ordering
c.AddFunc("@daily", job1, cron.WithOrder(1))
c.AddFunc("@daily", job2, cron.WithOrder(2))Use Cases
- Run cleanup jobs before main jobs
- Ensure resource preparation before consumers
- Predictable execution order for testing
- Priority scheduling under load
Severity
🟢 Low - Feature enhancement
Found By
Pre-1.0 release code review with Zen/Gemini
Metadata
Metadata
Assignees
Labels
apiAPI design changesAPI design changesenhancementNew feature or requestNew feature or requestneeds-discussionRequires discussion or approval before implementationRequires discussion or approval before implementation