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

Using with sidekiq delayed extensions #45

Closed
skalb opened this issue Aug 29, 2014 · 2 comments
Closed

Using with sidekiq delayed extensions #45

skalb opened this issue Aug 29, 2014 · 2 comments

Comments

@skalb
Copy link

skalb commented Aug 29, 2014

I'm currently using unique to guarantee I don't send multiple emails after jobs complete.

I end up having to wrap the email call in a worker like:

class UniqueMailer
  include Sidekiq::Worker

  sidekiq_options unique: true, unique_job_expiration: 30 * 60, unique_unlock_order: :never

  def perform(resource_id)
   Mailer.delay.mail(resource_id)
  end

It would be nice if something like the following worked:

Mailer.delay.mail(resource_id, unique: true, unique_job_expiration: 30 * 60, unique_unlock_order: :never)

or a new method

Mailer.delay.unique_mail(resource_id, unique: true, unique_job_expiration: 30 * 60, unique_unlock_order: :never)

Thoughts?

@mhenrixon
Copy link
Owner

This would be truly awesome, I sort of need that too. I hate having to create jobs to keep uniqueness. Unfortunately Sidekiq clears locks after 60 minutes now FYI. Don't rely on the unique args never getting cleared.

@todddickerson
Copy link

+1

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

3 participants