Sha256: e93d11e06f494b8ae6e69c90665c2f46eec70bf77effadd833a437e19f8e4018
Contents?: true
Size: 905 Bytes
Versions: 9
Compression:
Stored size: 905 Bytes
Contents
namespace :sphinx do desc "Run indexer" task :index do cd 'config' do system 'indexer --all' end end desc "Rotate idendexes and restart searchd server" task :rotate do cd 'config' do system 'indexer --rotate --all' end end desc "Start searchd server" task :start do if File.exists?('/var/run/searchd.pid') puts 'Sphinx searchd server is already started.' else cd 'config' do system 'searchd' puts 'Sphinx searchd server started.' end end end desc "Stop searchd server" task :stop do unless File.exists?('/var/run/searchd.pid') puts 'Sphinx searchd server is not running.' else pid = File.read('/var/run/searchd.pid').chomp system "kill #{pid}" puts 'Sphinx searchd server stopped.' end end desc "Restart searchd server" task :restart => [:stop, :start] end
Version data entries
9 entries across 9 versions & 1 rubygems