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

Allow for more descriptive errors during parsing #383

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jpalawaga
Copy link

I had a need to improve the error handling around the Parse function. Specifically, if Itoa failed it yield a nasty error.

I've only overhauled the cases that I need, but I'm happy to invent a couple other error types for completeness for the rest of parse.go, but only if this changelist is something along the lines that you'd actually care to accept. If it isn't something you're interested in, no worries.

Thanks for building the package!

jpalawaga and others added 7 commits March 23, 2021 18:51
If Cron is not active when a schedule occurs, it's possible we'll miss
a task that we need to run. We've seen this happen when schedules
coincide with a deploy.

This commit adds a configuration option which will allow us to set the
initial start time. We can "catch up" missed tasks by passing the
shutdown time on creation.
We've previously added support for setting the "epoch" for our cron;
that is, when we should start scheduling from. However, we were also
using the epoch as the initial time for computing how long to wait
until the next job should run. This resulted in drift of `now - epoch`.

With this commit the initial time is _always_ the current time; the
epoch defaults to the current time, unless overridden.
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.

2 participants