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
I'm having a situation where I would like to replace the original job when a new job with similar parameters is added to the queue.
In my app I'm using RecordWorker to update records in background jobs, one job per record. When all records have been updated AnotherWorker should start processing the data. Currently I'm having each background job calling AnotherWorker.perform_in(1.hour, params), and the AnotherWorker uses unique: :until_executing. I'm practically hoping that all records have been updated within one hour.
Instead of this, when a new AnotherWorker job is put into the queue I would like to remove the previous job. Then I would be sure that the AnotherWorker starts one hour after the last record is updated.
Would something like this be possible to do? Or do you know that something is preventing this kind of functionality?
The text was updated successfully, but these errors were encountered:
👋 This would be a great feature to have if it's still up for consideration. We currently have our queue getting a lot of duplicate jobs as a result of the TTL strategy, and don't want to increase it too high to prevent faster retries, so replacing the job with a new one would be a nice middle ground.
In the meantime we'll just bump the lock_expiration up though 😄
Hi,
I'm having a situation where I would like to replace the original job when a new job with similar parameters is added to the queue.
In my app I'm using RecordWorker to update records in background jobs, one job per record. When all records have been updated AnotherWorker should start processing the data. Currently I'm having each background job calling
AnotherWorker.perform_in(1.hour, params)
, and the AnotherWorker usesunique: :until_executing
. I'm practically hoping that all records have been updated within one hour.Instead of this, when a new AnotherWorker job is put into the queue I would like to remove the previous job. Then I would be sure that the AnotherWorker starts one hour after the last record is updated.
Would something like this be possible to do? Or do you know that something is preventing this kind of functionality?
The text was updated successfully, but these errors were encountered: