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 have the following ActiveJob declaration with Sidekiq backend, and noticed that the job is not re-enqueued when an error is raised that has a retry_on declaration. I would have expected the job to retry.
You can fix this by creating a file at lib/active_job/uniqueness/strategies/until_executed_patch.rb:
# frozen_string_literal: truerequire"active_job/uniqueness/strategies/until_executed"moduleActiveJobmoduleUniquenessmoduleStrategiesclassUntilExecutedPatch < UntilExecuteddefbefore_enqueuereturniflock(resource: lock_key,ttl: lock_ttl)# We're retrying the job, so we don't need to lock againreturnifjob.executions > 0handle_conflict(resource: lock_key,on_conflict: on_conflict)abort_jobendendendendend
In config/application.rb add the following to the end of the file:
## Context
`retry_on` does not work with `until_executed` strategy.
veeqo/activejob-uniqueness#75
## Description
This PR updates all the jobs that are affected with this issue - a
combination of `retry_on` and `unique :until_executed`
I have the following ActiveJob declaration with Sidekiq backend, and noticed that the job is not re-enqueued when an error is raised that has a retry_on declaration. I would have expected the job to retry.
The text was updated successfully, but these errors were encountered: