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

Unique job showing weird behavior #153

Closed
kapso opened this issue Dec 10, 2015 · 1 comment
Closed

Unique job showing weird behavior #153

kapso opened this issue Dec 10, 2015 · 1 comment

Comments

@kapso
Copy link

kapso commented Dec 10, 2015

Given the following worker:

class ReminderWorker < BaseWorker
  sidekiq_options queue: :reminder,
                  unique: true,
                  unique_unlock_order: :never,
                  unique_job_expiration: 7.days.to_i

  def perform(user_id)
    wrap_perform do
      Reminder.call(user_id: user_id)
    end
  end
end

I enqueue the following job:

irb(main)> ReminderWorker.perform_in(7.days, 45)
=> "eb0890b735275ada958c75cd"

I would expect the job to be de-duped, however when I run the following a day later, enqueuing is a success, why? _Is this expected or a bug?_

# A day after enqueuing the above job, enqueuing this job is a success? Why?
irb(main)> ReminderWorker.perform_in(5.seconds, 45)
=> "a8ae57d4ccbfd1922874ad62"

# A minute later, enqueuing job is rejected as expected
irb(main)> ReminderWorker.perform_async(45)
=> nil

Using the following gems:

gem 'sidekiq-unique-jobs', '3.0.15'
gem 'sidekiq', '4.0.1'
@mhenrixon
Copy link
Owner

Upgrade to 4.0.12

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