Closed laixintao closed 2 years ago
You can turn on ALLOW_PARALLEL_RUNS to allow for the job to run every minute. But this is a global option for all jobs.
Unless you are referring to having parallel runs for a single job and the other jobs not allowed to run in parallel. This case is not possible at the moment.
Thanks for reply.
The case is, I have 4 runcrons
runs parallelly, and I have a cronjob run for every minute, but one job cost 3 minutes.
Let's say, at 00:01, one job started, and, at 00:02, the job hasn't finished, so all other 3 process was blocked. The next run could be at 00:04 ( when the 00:01 job finished).
If I turn ALLOW_PArALLEL_RUNS on, then at 00:01, the job will be run 4 times. (because I have 4 runcron
process)
You are right " all of the jobs will be delayed, aka, the job actually behave like running every 3min."
It behaves the same way for run_at_times
. If the first task doesn't complete, the second task will be delayed and will run right after the first.
What if I have a cron job run every minute, but the job cost 3min to finish?
From the code I think all of the jobs will be delayed, aka, the job actually behave like running every 3min.
Can we add
H:M
to lock name? Like change this tof{jobname}-{hour}:{minute}
? But if so, we have to query the db first, I am not sure if there are any race conditions.