Я хочу запланировать, чтобы мой рабочий использовал задание cron, чтобы периодически проверять подключение к базе данных (например, 5 минут) и обновлять ключ memcache. поэтому в моем приложении, если я найду переменную memcache, которая будет установлена. Я делаю свои страницы по-другому, тогда, когда база данных готова.workling не работает, когда база данных не работает в моем приложении rails
Но проблема заключается в том, что рабочий знак запускается, когда база данных не работает. когда база данных завершена. он правильно обнаруживает, что соединение с базой данных присутствует и обновляет переменную memcache, и все работает нормально.
Я не знаю, почему рабочий не запускается, когда база данных не работает. Я истекаю в конце срока. любая помощь очень ценится!
Update:
Это ошибка, я получаю, когда workling не начинает
/apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/ gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/mysql_adapter.rb: 527: in real_connect': Can't connect to MySQL server on '10.223.2.50' (111) (Mysql::Error) from /apps/Symantec/shasta/website/vendor/plugins/workling/script/../lib/workling/starling/poller.rb:35:in
join ' от /apps/Symantec/shasta/website/vendor/plugins/workling/script/../ lib/workling/starling/poller.rb: 35: in listen' from /apps/Symantec/shasta/website/vendor/plugins/workling/script/../lib/workling/starling/poller.rb:35:in
каждый ' от /apps/Symantec/shasta/website/vendor/plugins/workling/script/../lib/workling/starling/poller.rb:35: в listen' from /apps/Symantec/shasta/website/vendor/plugins/workling/script/listen.rb:19 from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in
Нагрузка ' из /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:203:in start_load' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/application.rb:296:in
start ' из /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb: 51: in watch' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:51:in
fork ' от /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor .rb: 51: in watch' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:45:in
каждый ' от /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/ daemons/monitor.rb: 45: in watch' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:44:in
loop ' от /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0 /lib/daemons/monitor.rb:44:in watch' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:84:in
start_with_pidfi le ' из /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:64 : in fork' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor.rb:64:in
start_with_pidfile ' из /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/monitor. rb: 111: in start' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/application_group.rb:149:in
create_monitor ' от /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons /application.rb:283: in start' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/controller.rb:70:in
run ' /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/ lib/daemons.rb: 143: in run' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in
вызов ' из /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0 /lib/daemons/cmdline.rb:112:in catch_exceptions' from /apps/Symantec/shasta/website/install/local/ruby-1.8.7-p299/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:142:in
run ' from script/workling_starling_client: 17
Я прикрепил исключение, брошенное рабочим. – anusuya 2010-11-26 13:36:02