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

feat: Add support for shorthand cron expressions #1733

Merged
merged 7 commits into from
Jun 12, 2024
Merged

Conversation

gak
Copy link
Contributor

@gak gak commented Jun 11, 2024

Fixes #1628

Supports:

  • Every n seconds: //ftl:cron 10s
  • Every n minutes: //ftl:cron 30m
  • Every n hours: //ftl:cron 12h (Starting at UTC midnight)
  • Day of the week (UTC midnight): //ftl:cron Friday or //ftl:cron Fri
    • Case insensitive with at least the first 3 chars of the day name.

@gak gak requested a review from alecthomas as a code owner June 11, 2024 06:24
@gak gak requested review from a team and matt2e and removed request for a team June 11, 2024 06:24
@github-actions github-actions bot changed the title Add support for shorthand cron expressions feat: Add support for shorthand cron expressions Jun 11, 2024
@ftl-robot ftl-robot mentioned this pull request Jun 11, 2024
internal/cron/pattern.go Outdated Show resolved Hide resolved
internal/cron/pattern.go Outdated Show resolved Hide resolved
@gak gak enabled auto-merge (squash) June 11, 2024 20:55
@alecthomas
Copy link
Collaborator

Just a reminder on top of standup to please add this info to the docs!

@gak gak disabled auto-merge June 11, 2024 22:28
@gak gak force-pushed the gak/short-cron-durations branch from ef5945c to 0a1a7d4 Compare June 11, 2024 22:30
@gak gak merged commit 990158e into main Jun 12, 2024
39 checks passed
@gak gak deleted the gak/short-cron-durations branch June 12, 2024 01:18
time.Date(2025, 6, 6, 0, 0, 0, 0, time.UTC),
},
}},
// TODO: These two are failing on the NextAfter with inclusive=true
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤦‍♂️ #1763

@matt2e matt2e added the approved Marks an already closed PR as approved label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Marks an already closed PR as approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for shorthand cron expressions
3 participants