-
Notifications
You must be signed in to change notification settings - Fork 387
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
Immediately run jobs #578
Comments
This relates to #460. My (currently only) comment there applies to this as well, including the part about the use case. @alexahnfetch Regarding the use case: I (dare I say we) would like to understand what it is that you are trying to accomplish with such a feature. Running a job immediately can be accomplished by programmatically running it (has to exist already, oc) using the API: POST to /jobs/{job_name} Come to think of it, supporting running immediately could be implemented by adding semantics to the API instead of messing with the scheduler. Something like |
When I started using dkron some time ago I faced exactly the same issue: dkron was great for scheduled tasks, but it was also great to run one-time async jobs. So, I looked for how to run "immediately" (didn't even try So I just went with an hardcoded date in the past for those jobs. I create it and I trigger it and it has been working just fine @alexahnfetch But I do second the request to have it more official, either by being able to setup jobs with no schedule (to trigger manually right after) or with a "now"/"asap" schedule. |
Interesting conversation here, I can understand the need to run a job inmediately, but regarding:
Looks to me like a task for a background jobs queue, not dkron but certainly it can do it. @fopina and @alexahnfetch, under your use case, do you want the inmediate job to dissapear after being executed or you exepect to have it around? |
I, personally, would expect it to lie around so I can check execution times and view logs/stats after it’s done, pretty much like it does now setting an invalid @at and starting manually. |
@yvanoers I'd like the possibility of using dkron as a task queue. It doesn't seem natural to issue two REST calls to run a job immediately, as it leads to more error handling code due to REST calls potentially failing. If dkron is a way to control when jobs get executed (e.g. controlling time), then the @Victorcoder I'd like it to behave just like any other job so I can see if it was executed or not. |
Given the fact that you can not create an issue without schedule (except when it has a parent job), without looking at the code I would say to add a new special directive |
@alexahnfetch Thanks for your explanation. @Victorcoder, IMHO Using an API request parameter has the additional benefit of allowing jobs that do have a regular schedule to be started once at creation and then follow their regular schedule, without having to change the schedule afterwards (or set the schedule correctly at creation and kick them off programmatically afterwards). |
Implemented in #592 |
Previously mentioned in #509, but I'm opening a ticket hoping that I can change your mind. Setting an arbitrary padding to set a future schedule date is not a rigorous solution, and it forces developers to think about all the things that can potentially go wrong (e.g. clock skew) - to the point that they will conservatively use a large padding.
It would be nice if we had something like:
or allow an empty
schedule
field:where an empty
schedule
field specifies an immediately run job (similar to https://mesos.github.io/chronos/docs/api.html#adding-a-scheduled-job).Expected Behavior
Actual Behavior
Specifications
The text was updated successfully, but these errors were encountered: