Rails + Devise + delayed_job?

后端 未结 9 1919
长情又很酷
长情又很酷 2020-12-24 07:38

I have a Rails 3 App using Devise on Heroku. Problem is I\'m sending emails with Sendgrid and email delivery is slow, it makes the app hang. So I\'m interested in using dela

相关标签:
9条回答
  • 2020-12-24 08:31

    For delayed_job_active_record with Devise , just use the following . (add it to user.rb model )

    handle_asynchronously :send_devise_notification, :queue => 'devise'
    
    0 讨论(0)
  • 2020-12-24 08:37

    this is the thing that worked for me:

    in app/models/user.rb

      # after your devise declarations
      handle_asynchronously :send_reset_password_instructions
      handle_asynchronously :send_confirmation_instructions
      handle_asynchronously :send_on_create_confirmation_instructions
    

    you may not need all of them depending on which devise modules you are including

    0 讨论(0)
  • 2020-12-24 08:40

    According to the Devise wiki page, the devise-async gem will handle this for you. It supports delayed_job, resque, and sidekiq.

    0 讨论(0)
提交回复
热议问题