Hi,
What I'm trying to determine:
As my worker executes, I want to determine whether this current run is 'stale', by checking the created_at of the job vs the db record I expect to update, in case another job has already updated said db record.
Why:
This worker calls an external service, then updates the db record. Sometimes that service will throttle us causing the job to fail. I let the exception bubble up and allow sidekiq to retry. However, due to other actions in the system, that same job may be triggered for the same record. Therefore, while one job is on the retry timeout, this new job may succeed (not throttled by the service), then when the original job is retried, it no longer needs to do the work.
I try this while the #perform method is running:
::Sidekiq::Queue.new.find_job(jid)
but it's always returning nil.
My job is running on the default queue and my version is:
> ::Sidekiq::VERSION
Thanks