Skip to content

Job will not enqueue even with no existing match #342

@aaronmtate

Description

@aaronmtate

I tried enqueueing several jobs. The uniqueness limitation worked for jobs that would enqueue at all. Others simply would not add to the queue no matter what. The enqueuing method would return nil. No other job with the same parameter existed in the queue at the time.

Worker class

module CommissionLedgerTracker
  class QueuedUpdate
    include Sidekiq::Worker
    sidekiq_options queue: 'commission_ledger_update'
    sidekiq_options lock: :while_executing

    def perform(account_id)
      CommissionLedgerTracker::AddToAccount.new(account_id: account_id).process
    end
    ...
end
CommissionLedgerTracker::QueuedUpdate.perform_async(account_id)

We do use ActiveJob for most other jobs. My assumption regarding the mentioned incompatibility was that this should at least work if I specify the class as being a Sidekiq::Worker. I would try with one number for account id (say 12345) and it simply wouldn't enqueue, though 12346 would enqueue just fine even if the related account record didn't exist. This was not limited to one specific id, but failed for a significant number of them.

sidekiq-unique-jobs version was 6.0.6

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions