Skip to content

Add support for on_conflict: :log for UntilExecuting lock #408

@lairtonlelis

Description

@lairtonlelis

When setting a worker with on_conflict: log configuration and the until_executing or the until_and_while_executing locks, like the worker below:

class ExampleWorker
  include Sidekiq::Worker

  sidekiq_options lock: :until_and_while_executing,
                         on_conflict: :log

  def perform(fund_id)
    puts 'performed...'
  end
end

the logs are misleading, showing a message like this:

2019-04-29T16:54:27.402Z 1 TID-oxrddqzzp SidekiqUniqueJobs::Client::Middleware DIG-uniquejobs:d7e6681a477cc2e705a03b6628b093c6 INFO: skipping job with id (a7540e0b85eaed075b877362) because unique_digest: (uniquejobs:d7e6681a477cc2e705a03b6628b093c6) already exists

But the job is not skipped and gets executed by the sidekiq worker.

A possible solution would be to add support for on_conflict: :log configuration for the until_executing and until_and_while_executing locks, as this is not currently supported (shown here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions