diff --git a/vendor/plugins/acts_as_solr_reloaded/lib/tasks/solr.rake b/vendor/plugins/acts_as_solr_reloaded/lib/tasks/solr.rake index 16617a0..2eab4f5 100644 --- a/vendor/plugins/acts_as_solr_reloaded/lib/tasks/solr.rake +++ b/vendor/plugins/acts_as_solr_reloaded/lib/tasks/solr.rake @@ -66,13 +66,19 @@ namespace :solr do require File.expand_path("#{File.dirname(__FILE__)}/../../config/solr_environment") fork do if File.exists?(SOLR_PID_FILE) + killed = false File.open(SOLR_PID_FILE, "r") do |f| pid = f.readline - Process.kill('TERM', pid.to_i) + begin + Process.kill('TERM', pid.to_i) + killed = true + rescue + puts "Solr could not be found at pid #{pid.to_i}. Removing pid file." + end end File.unlink(SOLR_PID_FILE) Rake::Task["solr:destroy_index"].invoke if ENV['RAILS_ENV'] == 'test' - puts "Solr shutdown successfully." + puts "Solr shutdown successfully." if killed else puts "PID file not found at #{SOLR_PID_FILE}. Either Solr is not running or no PID file was written." end -- libgit2 0.21.2