-
Notifications
You must be signed in to change notification settings - Fork 21
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
ISO8601 Support #13
Merged
Merged
ISO8601 Support #13
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4cb0800
Remove SKIP LOCKED from Front() to support MariaDB.
tooolbox 440d3e0
Make the SKIP LOCKED optimization configurable.
tooolbox cb0f3cf
Added basic ability to mock time.
tooolbox d4146c8
Client with Schedule method.
tooolbox 19ebdd9
Full client.
tooolbox abcecdc
Refactor test.
tooolbox e6c4b89
Added working test for the client.
tooolbox 5292628
Merge branch '20200804-mariadb-compat' into 20200818-skip-locked-client
tooolbox 2689f6b
Export the clock.
tooolbox eecf99e
Separate out the UpdateInstance call into 2 prepared statements, due …
tooolbox 9a1614b
Merge branch 'master' into 20200818-skip-locked-client
tooolbox 7339c07
Merge branch 'master' into 20200818-mocktime
tooolbox 26466a5
Merge branch '20200818-skip-locked-client' into 20200819-mocktime-client
tooolbox 0eb625d
Added TestAddJob for table.
tooolbox 77c8123
Fully removed dropTables
tooolbox bc875c5
Merge branch 'master' into 20200819-mocktime-client
tooolbox 1938256
Compiling, working on tests.
tooolbox cb375d8
Cast injected times to DATETIME to prevent loss of time.
tooolbox 0b29a68
Revert extraneous logging.
tooolbox 15baac1
Merge branch 'master' into 20200819-iso8601
tooolbox 9b0b3c0
Added iso8601 schedule tests, not all passing yet.
tooolbox 5d3ac3f
Recurring tests pass.
tooolbox 520bf12
All tests pass together.
tooolbox 660067b
Speed up tests.
tooolbox f4e8af2
Timezone support passing tests.
tooolbox d72b844
Added UTC test.
tooolbox 8930f85
Fix deadlocks.
tooolbox d1a3be3
Added failing test for AddJob returning a timezoned job.
tooolbox 35186a0
Fixed failing test.
tooolbox 5be7c20
Added passing test to ensure Front returns timezoned job.
tooolbox 0dc5ee9
Added failing test to ensure Get returns a timezoned job.
tooolbox 475c799
Fixed failing test.
tooolbox fe1db87
Removed extraneous DB call.
tooolbox 7c01c4d
Style and consistency cleanup.
tooolbox 23cd338
Add note about UseClock as per #13
tooolbox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to change
RetryInterval
to ISO duration? If not, I would like to keep it as seconds for simplicity. A user can start to use Dalga without knowing about ISO durations?While we are doing a major version bump, I would also like to change the config file format to TOML, it is more common nowadays.
github.com/BurntSushi/toml
library has also ability to unmarshaltime.Duration
values. Do you have any comments on this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It had something to do with how the data was being passed and compared between functions and so on. Ah yes, I was changing
Table.UpdateNextRun()
to take an ISO8601 duration, but I found that the same code path was used for a successful and a failed execution, so RetryInterval would need to feed into the same argument.It just seemed silly to have
Table.UpdateNextRun()
have both an ISO8601 and regulartime.Duration
and use one or the other. I suppose I could do a conversion fromtime.Duration
into ISO8601 before passing it in?Separate from the above, I'm not sure I understand. Won't he need to know ISO8601 durations now because that's how you schedule regular intervals? Unless you're thinking of one-off jobs specifically.
Heh, personally I don't like TOML. Every time I go to read up on the documentation, I get to the part of how you can use
[[something]]
orsomething.something
and they're basically the same except they're not, and I get confused and abandon the attempt.I am a YAML fan, if you're into that. I find it's intuitive and easy to use that config format, as long as I'm not the one writing the parser for it 😉
I have used spf13/viper pretty extensively in the past and like it, although it has a lot of dependencies. I would probably only go that way if you considered switching to spf13/cobra for the CLI framework, since they integrate very well. But then, I have seen very minimal dependencies and mostly stdlib in Dalga so I doubt you want to go that route.
Something like knadh/koanf might do, or even just a straight YAML parser. But that depends on how you feel about YAML. I am also a fan of HJSON 😄