调试Rufus调度程序 [英] Debugging Rufus scheduler
问题描述
我正在Rails控制台中执行此操作:
I am doing this in my Rails console:
job = scheduler.at 1.minute.from_now do Service.log.debug 'scheduler works' end
job.schedule_info
=> Wed, 07 Aug 2013 16:14:46 UTC 00:00
scheduler
在其他文件中定义:
require 'rubygems'
require 'rufus/scheduler'
def scheduler
@scheduler ||= Rufus::Scheduler.start_new
end
当我在控制台中运行时:
And when I run in console:
Service.log.debug 'scheduler works'
服务日志文件已写入.
scheduler.at 1.minute.from_now do Service.log.debug 'scheduler works' end
一分钟后不写日志.我想念什么?我该如何调试呢?
Does not write in the log after a minute. What am I missing? How could I debug this?
我在EC2中有一台服务器似乎已关闭,并且计划的任务未运行.
I have a server in EC2 that seems is shutdown and scheduled tasks are not run.
在我的开发环境中,我测试了一个在一分钟内运行的任务,并且该任务可以正常工作.这在服务器中而不在控制台中.正如我提到的,在控制台中失败了.
Thing is that in my development environment I test with a task running in one minute and it works. This is in server not in console. In console, as I mentioned is failing.
红宝石1.9.3p327(2012-11-10修订版37606)[x86_64-darwin12.0.0]
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.0.0]
瘦1.5.0
红宝石1.9.3p429(2013-05-15修订版40747)[x86_64-linux]
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]
apache2 2.2.22
apache2 2.2.22
乘客4.0.5
导轨3.2.8
rufus-scheduler 2.0.18
rufus-scheduler 2.0.18
推荐答案
我不得不使用"PassengerSpawnMethod direct"设置使其正常工作.
I had to use the "PassengerSpawnMethod direct" setting in my Apache VirtualHost for my Dashing application (which uses rufus-scheduler) to get it to work correctly.
这篇关于调试Rufus调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!