Does Sidekiq guard against a job running on top of itself? #5480
-
|
I am embarrassed to ask this but I am not finding the answer obvious. Let's say I have three jobs: JobA, JobB and JobC. I have externally used a scheduler (let's just say cron) to run JobA every 5 minutes. Therefore, every 5 minutes cron will do JobA.perform_later. What happens if a run of JobA takes 8 minutes? 5 minutes in, JobA.perform_later will be executed while the previous JobA.perform_later is still running. Is Sidekiq smart enough to not run a job if it's already running, or would two JobAs end up running simultaneously? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Wondering now if this is the Unique Jobs feature only in Enterprise... |
Beta Was this translation helpful? Give feedback.
-
|
If there are two copies of a job, it will run both. Sidekiq is explicitly pro-concurrency. Yes, Unique Jobs is one way to limit concurrency, as is a concurrent Rate Limiter, both in Enterprise. |
Beta Was this translation helpful? Give feedback.
If there are two copies of a job, it will run both. Sidekiq is explicitly pro-concurrency. Yes, Unique Jobs is one way to limit concurrency, as is a concurrent Rate Limiter, both in Enterprise.