perform 里的 puts 一条也没有输出,求指点 调用方法:
every(5.seconds, 'test.job') { Delayed::Job.enqueue TestJob.new }
lib/test_job.rb :
class TestJob
def perform
puts "TestJob is start "
puts "=========================================="
puts "TestJob is end "
puts "=========================================="
end
end
执行结果:
17:49:35 clock.1 | I, [2013-01-30T17:46:44.923628 #25713] INFO -- : Starting clock for 1 events: [ test.job]
17:49:42 clock.1 | I, [2013-01-30T17:49:42.997396 #25817] INFO -- : Triggering 'test.job'
17:49:48 clock.1 | I, [2013-01-30T17:49:48.104511 #25817] INFO -- : Triggering 'test.job'