Delayed Job Rake Task Failing

后端 未结 1 422
渐次进展
渐次进展 2021-01-22 00:34

I\'m trying to get delayed job to work as a rake task, but for the life of me I can\'t figure out what I\'m doing wrong. Given the following setup:

#config/envi         


        
相关标签:
1条回答
  • 2021-01-22 00:52

    DelayedJob defines handle_asynchronously in Delayed::MessageSending::ClassMethods. DelayedJob automatically monkey-patches that module into Module in its lib/delayed_job.rb. You'll likely have better luck requiring that in your Rake task:

    #Rakefile
    begin
      require 'delayed_job'
      require 'delayed/tasks'
    rescue LoadError
      STDERR.puts "Run `rake gems:install` to install delayed_job"
    end
    
    0 讨论(0)
提交回复
热议问题