【发布时间】:2011-03-16 21:40:57
【问题描述】:
我刚刚启动并运行 resque-schedule,它适用于一项计划任务。但是,当我在同一个 cron 计划上添加第二个时,它似乎在自己踩踏。这是我的 resque_schedule.yml 的样子:
email_subscription_notification:
cron: * * * * *
class: SubscriptionProcessor
args: test
description: Email Notifications
email_polling:
cron: * * * * *
class: EmailPollingProcessor
args: test
description: Email Polling
当我通过 rake resque:scheduler 运行时,我会收到周期性错误:
2011-03-15 17:43:00 Failed to enqueue EmailPollingProcessor:
Got '0' as initial reply byte. If you're running in a multi-threaded environment, make sure you pass the :thread_safe option when initializing the connection. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking.
如果我将时间表更改为只使用其中一个,它们会玩得很好。如果我将 cron 计划更改为不重叠,它们运行良好。感谢您的任何帮助。 OSx 10.6.6,Ruby 1.9.2p136。
请注意,两个类的 perform 方法现在都只有用于调试的 puts。
【问题讨论】: