-
Notifications
You must be signed in to change notification settings - Fork 984
Support for parsing of string interval definitions #179
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
Conversation
ac33fd2 to
4aa3b77
Compare
4aa3b77 to
10a1edb
Compare
|
Perhaps it would be better to use the |
10a1edb to
ac6db85
Compare
1 similar comment
ac6db85 to
0d08f59
Compare
|
Are there any chances of getting this merged? I would very much appreciate your feedback. Thanks! |
|
Great feature. I actually use it but i also wait this merge. |
|
Yeah, I know. ;) I needed it for this: https://github.com/ljanyst/scrapy-do but pretty useful in general. |
|
I'm very hesitant to go forward with this. You are proposing to add a new syntax to define a job interval as a string. This already exists: cron. If you want to encode a scheduling interval as a string (could be in a file, via an api or somewhere else) I would recommend to use the cron syntax. It is widely supported and interpretes exist in many languages (like python). Schedule is a simple Python job scheduler. It does not support advanced features like job persistence or string parsing because other tools already do this a lot better. This library is for projects that do not need all the advanced features that APSchedule offers. The feature you are proposing is one of those advanced features that APSchedule supports, and this library won't. See There are for sure projects out there where encoding a job definition as a more human readable string is required, and the code you wrote seems like a good implementation. I encourage you to publish it in your own repository, add an readme with proper documentation. You could do this as a fork of this project, or even better, create a standalone library that parses strings into schedule |
|
That's certainly your choice. If I wanted cron I would have used cron. |
As a user, I want to be able to specify an interval definition as a string. This pull request implements this functionality. It parses the input string and calls the appropriate properties and functions. It slightly abuses
asserts but you did not define any custom exceptions and I wanted to follow your style.This is how it works: