resque-schedule を起動して実行しているところですが、1 つのスケジュール タスクで問題なく動作します。ただし、同じ cron スケジュールに 1 秒追加すると、それ自体が踏みにじられているように見えます。私の 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、ルビー 1.9.2p136。
両方のクラスの perform メソッドには、現在デバッグ用の put しかないことに注意してください。