-
Notifications
You must be signed in to change notification settings - Fork 38
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
Exposing simple REST endpoint to report what will run #23
Comments
I wouldn't mind such a feature. However, it's not so easy to implement, due to the way yacron is built on top of the
It's not terrible for low number of jobs and small interval, but it scales badly. If you accept that it might be slow, I guess we can have it. As long as the aiohttp handler does an |
Correct me if I'm missing something obvious, but as per the docs wouldn't methods under "Schedule Functionality" be exactly what we'd need? |
I think you linked to the wrong module, yacron is using the python module But that point is moot, as the So, yes, should be pretty simple to add a REST API to get what you want. If you want to work on this:
|
Thanks, both points make complete sense.
…On Wed, Nov 7, 2018 at 3:40 AM Gustavo J. A. M. Carneiro < ***@***.***> wrote:
I think you linked to the wrong module, yacron is using the python module
crontab, python-crontab is a different module, with a different API.
But that point is moot, as the crontab module has that get_next() API.
Yes, you are right, I didn't remember that API.
So, yes, should be pretty simple to add a REST API to get what you want.
If you want to work on this:
1. I prefer to use aiohttp (it is an outstanding http framework for
this sort of thing and I use it a lot);
2. There should be an option to opt in to enabling the REST interface,
otherwise security people will bite my head off. I personally don't care (I
always run yacron in docker container), but some people might care. There
should be options to configure the bind host and bind port.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIEbRXF7k1gNjXs0u53uP-3h_JdAfeuwks5ussafgaJpZM4YRhPW>
.
|
@gjcarneiro raising a question here since I don't know if there's a better place
In our environment, we find it highly desirable to be able to answer questions like "what is scheduled to run in X [unit of time]"? For a simple use case, consider yacron triggering a (presumably long-ish) action within a running process; so if we intend to redeploy the said process, we want to make sure no relevant actions are about to take place within 10 minutes or so.
Of course we can read and mentally parse the yaml config, but it's not very human-friendly activity and requires mental date/time arithmetics. Hence we've been contemplating exposing a very simple HTTP API that can be interrogated to get ordered list of (job, timestamp) tuples for all jobs scheduled to run X units of time from now.
Have you ever considered this kind of feature? Will you accept a PR for such feature?
Thanks!
The text was updated successfully, but these errors were encountered: