vendredi 8 janvier 2016

Delayed job not working with ruby 2.2.1 and rails 3.2.22

I have update my project to use ruby 2.2.1 which should be supported on Rails 3.2.22 (see http://ift.tt/1SljFVk)

My delayed_jobs are broken:

class Feedback 
  TestJob = Struct.new(:id) do
  def perform
    puts "test job running #{id}"
  end
  def self.run_test_job
    Delayed::Job.enqueue TestJob.new(1)
  end
end

In the rails console (development) I do Feedback.run_test_job

While having a worker running rake jobs:work

I got this

[Worker(host:pro-vincent.home pid:62850)] Starting job worker
[Worker(host:pro-vincent.home pid:62850)] Job Feedback::TestJob (id=39) RUNNING

It should print test job running 1. I tested with ruby 2.1.1, it works fine.

What am I missing to make it work?

Aucun commentaire:

Enregistrer un commentaire