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

The second job does not run, even if it has different arguments #69

Closed
krzkrzkrz opened this issue Dec 17, 2014 · 1 comment
Closed

Comments

@krzkrzkrz
Copy link

The second job does not run, even if it has different arguments.... Why is this?

# WORKER
class FooWorker
  include Sidekiq::Worker

  sidekiq_options({
    # Mitigates from race conditions Should be set to true (enables uniqueness for async jobs)
    unique: :true,
    unique_job_expiration: 5.minutes.to_i, # Unique expiration (optional, default is 30 minutes)
    unique_args: :unique_args,

    retry: false,
    backtrace: true
  })

  def self.unique_args(foo, bar)
    [foo, bar]
  end

  def perform(*args)
    sleep(30.seconds)
  end
end


# In Rails console
FooWorker.perform_async(4, 4) # => "defa813c6ff16a6b9dba6f6a"
FooWorker.perform_async(5, 5) # nil
@krzkrzkrz
Copy link
Author

Nevermind, seems to work

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

1 participant