Here is what I have in my enviornment.rb. I understand there have been issues with restarting because o开发者_高级运维f a bug in the "daemons" gem and that the ghazel-daemons fixes it. But its not working in my case. I am using the collectiveidea 2.1.0--pre version of DJ, rails 2.3.5.
config.gem 'delayed_job', :source => 'http://rubygems.org', :version
=> "2.1.0.pre"
config.gem "ghazel-daemons", :lib => "daemons", :source => 'http://
gems.github.com'
gem "ghazel-daemons"
require "daemons"
But I stil can't get delayed_job to restart from capistrano.
desc "Restart the delayed_job process"
task :delayed_job_restart, :roles => :app do
run "cd #{current_path};#{get_rails_env} script/delayed_job
restart"
end
Thanks
I am currently using 2.0.3 without problems in 2.3.8, I believe that 2.1.0 is for rails 3 (reference).
I have not heard about the ghazel-daemons
gem, I currently have the following patch within the rails application running against with the daemons gem:
patch: http://blog.rapleaf.com/dev/wp-content/uploads/2008/07/daemons_extension.rb
writeup: http://blog.rapleaf.com/dev/2008/02/15/making-sure-ruby-daemons-die/
I'd say stick with the ghazel-daemons gem over monkey patching daemons.
Geoff's right though that you shouldn't be using delayed_job 2.1 with rails < 3.0, at time of writing the lastest rails 2 compatible delayed_job gem is 2.0.7.
精彩评论