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?
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:
It would be nice if something like the following worked:
or a new method
Thoughts?