Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lairtonlelis opened this issue Jun 17, 2019 · 1 comment
Closed

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

lairtonlelis opened this issue Jun 17, 2019 · 1 comment

Comments

@lairtonlelis
Copy link

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).

@mhenrixon
Copy link
Owner

Duplicate of #402

The log strategy is supported but since the server locks (the locks that create a unique lock as the server middleware is called) it isn't really that useful. That's why I decided to split the configuration to allow separate conflict strategies for the client and server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants