質問
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:スケジューラ経由で実行すると、定期的なエラーが発生します。
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。
両方のクラスに注意して、今すぐデバッグするための方法を実行する方法を実行します。
解決
わかりました、おそらく私自身の質問に答える悪いフォーム、謝罪...私はこれを見つけました だからスレッド そして、手がかりは追加することでした:thread_safe = true私がload_resque:
Resque.redis = Redis.new(:host => config['host'], :port => config['port'], :thread_safe => true)
注:これはRedis 2.1.1を使用していたので、Sthread_Safeがデフォルトであると読んだと思っていました。しかし、私はその記事を見つけていません...
所属していません StackOverflow