Closed Epigene closed 7 years ago
No, skip_first_run
does exactly what it says. If you set it to true in your example, it will skip the first time your job is scheduled to run at 1:45 AM. It's intended primarily for jobs w/o an :at
set, that run on startup. On platforms such as Heroku, that can lead to jobs running before they should as other dynos are booting, causing errors.
If you can help me understand what is confusing about the docs I can try to clarify them further.
My primary use-case is this: given a job definition of every(1.day, at: "01:45 am")
, I want to be safe as houses that this job will be performed just once a day at the specified time (with a reasonable margin of time error) even if I happen to deploy the application several times during the day.
Am I understanding correctly, that given that all my jobs all have an :at
set, I should be also using skip_first_run: false
then?
skip_first_run
is false by default. And yes, your job will only run if it is 1:45AM. The run on start applies only to periodic jobs w/o a specified time to run.
Ok, got it. I think this thread will suffice as clarification for anyone else interested in the option's behavior.
Thanks for clarifying!
Hi!
I'm reading through the documentation and have some worries about the meaning of the
:skip_first_run
option documented at https://github.com/Rykian/clockwork#skip_first_runSay I have a scheduled task like this:
My expectation is that if I deploy my code to production and restart clockwork at noon the task should not get executed, but reading the documentation I am led to believe that I should define my task like so:
Am I understanding this correctly? It seems to me that
skip_first_run: true
should be the default state..