Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting schedules with multiple values #24

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

adam-fowler
Copy link
Member

eg

let schedule = Schedule.onDays([.monday, .wednesday], hour: 10)
let schedule = Schedule.onHours([4, 16], minute: 0)
let schedule = Schedule.onMonths([.january, .july], date: 1, hour: 10)

@adam-fowler adam-fowler requested a review from Joannis as a code owner September 4, 2024 11:03
@adam-fowler
Copy link
Member Author

@thoven87

var prevDate = date
// Repeat while the nextDate is greater than the prevDate. At the point the nextDate is less than
// the previous date we know any schedules with multiple values have selected the correct next value
while prevDate < nextDate {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I think this will fix a current bug I notice where a job might not run until the metadata table is truncated. I have open a ticket yet because I am trying to get a reproducible example.

@thoven87
Copy link
Contributor

thoven87 commented Sep 4, 2024

PR looks good to me!

@adam-fowler adam-fowler requested a review from thoven87 September 5, 2024 07:12
Copy link
Contributor

@thoven87 thoven87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adam-fowler adam-fowler merged commit 885185c into main Sep 6, 2024
4 of 5 checks passed
@adam-fowler adam-fowler deleted the multiple-value-schedule branch September 6, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants