How to run Que jobs

905 Views Asked by At

I have installed the que gem and I would like to run the tasks I'm scheduling with active job, so far I have added in config/application.rb

config.active_job.queue_adapter = :que

and it stores the jobs in the database correctly but when I try to run

rake que:work

It starts but jobs are not working and I have reviewed run_at field, also tried running setting the env to RAIls_ENV=development. Tried with

que ./config/application.rb

and generates and error

I, [2016-06-15T17:30:27.592632 #30871]  INFO -- : {"lib":"que","hostname":"boris-Satellite-U845","pid":30871,"thread":9851100,"event":"worker_count_change","value":"4"}
I, [2016-06-15T17:30:27.592851 #30871]  INFO -- : {"lib":"que","hostname":"boris-Satellite-U845","pid":30871,"thread":9851100,"event":"mode_change","value":"async"}
/home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:109:in `connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/adapters/active_record.rb:54:in `checkout_activerecord_adapter'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/adapters/active_record.rb:7:in `checkout'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/job.rb:85:in `work'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:80:in `block in work_loop'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:75:in `loop'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:75:in `work_loop'
    from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:19:in `block in initialize'
1

There are 1 best solutions below

1
On

A bit late, but Que requires you to be running a Postgres Server for it work.

I would imagine this is why you are having issues.