mhfs / devise-async

Send Devise's emails in background. Supports Resque, Sidekiq, Delayed::Job and QueueClassic.
MIT License
575 stars 110 forks source link

Added capability of specifying delayed_job priority in configuration if used as a backend. #75

Closed sushantmittal closed 9 years ago

sushantmittal commented 9 years ago

By this command, we can set the default priority for all jobs.

But this solution works when we want to set different priority for all devise mails.

baschtl commented 9 years ago

@sushantmittal I did not mean to overwrite Delayed::Worker.default_priority. What I meant was @@delayed_job_priority = Delayed::Worker.default_priority instead of @@delayed_job_priority = 0.

sushantmittal commented 9 years ago

Oh I see. But it still sets the value 0 because of the following reason:

An application set the delayed_job default_priority in initializer. After the above change, default_priority will still get the value 0 that has been set in delayed_job gem instead of the value that has been set in an application.

sushantmittal commented 9 years ago

@baschtl

Can you merge it if looks fine ?

baschtl commented 9 years ago

Beyond that: +1

baschtl commented 9 years ago

@sushantmittal BTW: have a look at https://github.com/mhfs/devise-async/pull/56. IMO it introduces a more general approach to the problem at hand. Hence, we should use this version.

sushantmittal commented 9 years ago

@baschtl

Yeah it looks fine. I think only one test case missing in ' lib/devise/async.rb' for priority accessor. After that https://github.com/mhfs/devise-async/pull/56 is good to go.

baschtl commented 9 years ago

@sushantmittal Ok, #56 is merged. Hence, I will close this PR. Thanks nevertheless for your contribution!