I deleted my example as much as possible. In my application, I create a dummy class and try to set the invocation method to the queue. This is added to the database perfectly, and with the_jobs delay running in the background, it selects it and updates it to lock. But actually it does not finish the job. It just stays in a locked state.
pry(main)> class DummyClass pry(main)* def self.call pry(main)* puts 'will this ever work?' pry(main)* end pry(main)* end => :call pry(main)> DummyClass.delay.call (0.2ms) BEGIN SQL (0.3ms) INSERT INTO `delayed_jobs` (`created_at`, `handler`, `queue`, `run_at`, `updated_at`) VALUES ('2014-12-19 12:11:40.006107', '--- !ruby/object:Delayed::PerformableMethod\nobject: !ruby/class \'DummyClass\'\nmethod_name: :call\nargs: []\n', 'default', '2014-12-19 12:11:40.005811', '2014-12-19 12:11:40.006107') (16.2ms) COMMIT =>
Blocks the task here
SQL (0.8ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2014-12-19 12:17:20.031925', `delayed_jobs`.`locked_by` = 'delayed_job host:Ryan-Mes-MacBook-Pro-2.local pid:60080' WHERE ((run_at <= '2014-12-19 12:17:20.031003' AND (locked_at IS NULL OR locked_at < '2014-12-19 12:12:20.031154') OR locked_by = 'delayed_job host:Ryan-Mes-MacBook-Pro-2.local pid:60080') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1
Then it just freezes. I do not understand why such a simple task does not work.
Please note that this console is in my existing rails application. This may be an application configuration problem, but I could not find it.
Any ideas? I can try to give more information, but I think that is all.
The actual code I'm using is below
module Events class ForwardRequestToPulse def self.call puts 'will this ever work' end end end class MyTestController < ApplicationController def index Events::ForwardRequestToPulse.delay.call end end
The record is added to the delayed_jobs find table. When I run bin/delayed_job run , the record is blocked but not processed.
Below is an image of a locked record 