-
Notifications
You must be signed in to change notification settings - Fork 68
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
Job: save and execute immediately #230
Comments
The issue appears to be that the job is set to run: Inferring from the log entries, that appears to be ~24 hours in the future from the time when you ran the test. So, running You don't show the code that you used to actually create and schedule this job, so I don't know how it got that way. You can always force a job to become ready, even if it is not ready to run using either the |
Thank you for your reply.
According to your reply, then I can make it run immediately by adding job.ready() after I saved the job, right? the creating job could be like this:
|
When I set the schedule is 'at 3:00 am' the "after" : ISODate("2017-04-21T03:00:00Z") will always like that, even when I set job.after(new Date()) before job.save(). Then how can I make it run immediately after created? |
Hi, If you want it to run immediately, and then repeat after some delay, dont use To set the delay for the second (and all subsequent) runs you should use either the Hope that helps. |
I want to define a job, which will be scheduled to run later but will run 1 time immediately after job created. I tried to use jc.readyJobs, but seems It didn't work, or I had misunderstanding. Please help:
Here are my definition for job:
JC Definition
JobCollection
Cancel, restart, ready operations
I can cancel, restart the jobs, but can't make it ready.
The text was updated successfully, but these errors were encountered: