Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delayed_Job, How to set a priority for a user_mailer.rb method

I am using delayed_job w rails 3 to delay user_mailers, example:

 UserMailer.delay.email_digest(from,email,subject,html,text)

How can I add a priority? By default all delayed jobs are set to priority 0, for this mailer, I would like to make it less important with a priority of 1.

Possible? Thanks

like image 343
AnApprentice Avatar asked Sep 11 '12 19:09

AnApprentice


1 Answers

Options such as priority or which queue to use are options on the delay method, for example

UserMailer.delay(:priority => 2).email_digest(...)
like image 117
Frederick Cheung Avatar answered Sep 21 '22 12:09

Frederick Cheung