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

fix(cron): schedule accepts supported formats #149

Merged
merged 1 commit into from
Dec 4, 2020
Merged

fix(cron): schedule accepts supported formats #149

merged 1 commit into from
Dec 4, 2020

Conversation

wass3r
Copy link
Collaborator

@wass3r wass3r commented Nov 26, 2020

❤ THANKS FOR HELPING OUT :D

Proposed change

Addresses a regression that prevents the usage of all the supported scheduling formats, such as passing timezone into the schedule (eg. CRON_TZ=Asia/Tokyo 30 04 * * *) or predefined schedules (eg. @every 5m).

fixes #145

Types of changes

What types of changes is this pull request introducing to flottbot? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

You can fill this out after creating your PR. Put an x in the boxes that apply

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 203a1a474c89d16bb43138f6094e5e11c5c3ad5f-PR-149

  • 0 of 20 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 36.514%

Changes Missing Coverage Covered Lines Changed/Added Lines %
remote/scheduler/remote.go 0 20 0.0%
Files with Coverage Reduction New Missed Lines %
remote/scheduler/remote.go 1 0%
Totals Coverage Status
Change from base Build 048d1f21648a77956141462365b468c5eebec34b: -0.2%
Covered Lines: 838
Relevant Lines: 2295

💛 - Coveralls

_, err := cron.ParseStandard(rule.Schedule)
if err == nil {
// standard cron
job = cron.New(cron.WithChain(cron.SkipIfStillRunning(cronLogger)))
Copy link
Collaborator Author

@wass3r wass3r Nov 26, 2020

Choose a reason for hiding this comment

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

just calling out this part (SkipIfStillRunning) as it may be too opinionated. it seemed like a decent, sensible default, but i can be convinced to take it out or control it via flag as there might be use-cases 🤷‍♂️

ref: https://pkg.go.dev/github.com/robfig/cron/v3@v3.0.1#SkipIfStillRunning

@wass3r wass3r merged commit cafa811 into master Dec 4, 2020
@wass3r wass3r deleted the fix/cron branch December 4, 2020 16:03
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.

Scheduler is not accounting for ability to pass timezone info
2 participants