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

Every() accepts int, time.Duration, string to allow any custom duration between runs #119

Merged
merged 5 commits into from
Feb 6, 2021

Conversation

JohnRoesler
Copy link
Contributor

@JohnRoesler JohnRoesler commented Feb 5, 2021

What does this do?

Changes the Every() func in the scheduler allowing users to schedule any time.Duration between job runs via:

  • int + unit (e.g. Seconds)
  • time.Duration
  • string representation of time.Duration e.g. 1s

Which issue(s) does this PR fix/relate to?

closes #44

List any changes that modify/break current functionality

Have you included tests for your changes?

👍

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

example_test.go Outdated Show resolved Hide resolved
@JohnRoesler JohnRoesler changed the title add EveryDuration() for any desired duration between runs Every() accepts int, time.Duration, string to allow any custom duration between runs Feb 5, 2021
Copy link
Member

@Streppel Streppel left a comment

Choose a reason for hiding this comment

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

Amazing @JohnRoesler! Loved this! How about updating our README with the examples from ExampleScheduler_Every as well? EDIT: nvm, just saw that we have a checkbox for that too, sorry!

@JohnRoesler
Copy link
Contributor Author

@Streppel what about removing all the read me examples in favor of the go docs?

@Streppel
Copy link
Member

Streppel commented Feb 5, 2021

@Streppel what about removing all the read me examples in favor of the go docs?

I like this idea! Keep everything in one place. I'm all in for this.

@JohnRoesler JohnRoesler merged commit fc07510 into go-co-op:master Feb 6, 2021
@JohnRoesler JohnRoesler deleted the every-duration branch February 6, 2021 00:42
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.

[FEATURE] - Add a way to use a custom time.Duration
3 participants