You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a nightly task that sometimes takes a bit to run. How difficult would it be to support a "singleton" CRON task? I know the matthuhiggins/sidekiq-cron project supports this, but we use sidecloq for a few different types of jobs.
I'd be happy to jump in and do the work if you have some advice on how to approach the implementation (or if you think its a bad idea).
The text was updated successfully, but these errors were encountered:
do you mean a task that you don't want potentially overlapping itself? iow, a job that is scheduled each hour might take more than an hour to run, and if it is running, don't reschedule it?
if so, i've been torn conceptually about where the responsibility lies. CRON (as in linux CRON) itself doesn't provide this sort of feature right? i've had situations in the past like this, and i've left it up to the job to determine if it's stepping on itself. it's easy enough to grab a db or redis lock.
i'm tempted to stick with the unix philosophy and keep this tools as small and singularly focused as
possible, but i'm not totally against looking at some code.
i'd suggest implementing it as an in-job feature, and maybe post the code snippet here that you think is generic enough to be applied. basically, have logic in the job that says, "nope, i'm already running". i feel like that could spark some discussion, and we can see if it's worth integrating. (plus doesn't have you wasting time on PR that ends up being not included).
We have a nightly task that sometimes takes a bit to run. How difficult would it be to support a "singleton" CRON task? I know the matthuhiggins/sidekiq-cron project supports this, but we use sidecloq for a few different types of jobs.
I'd be happy to jump in and do the work if you have some advice on how to approach the implementation (or if you think its a bad idea).
The text was updated successfully, but these errors were encountered: