rt_sphinx 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rt_sphinx/manager.rb +7 -3
- data/rt_sphinx.gemspec +1 -1
- metadata +1 -1
data/lib/rt_sphinx/manager.rb
CHANGED
@@ -3,10 +3,14 @@
|
|
3
3
|
module RtSphinx
|
4
4
|
class Manager
|
5
5
|
def self.start
|
6
|
-
|
6
|
+
conf_file_path = File.join(File.expand_path('../../..', __FILE__), 'sphinx.conf')
|
7
|
+
kill_daemon_if_needed
|
8
|
+
puts `searchd --config #{conf_file_path}`
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.kill_daemon_if_needed
|
12
|
+
`pid=$(lsof -i :9327 -t); if [ $pid ] ; then kill -TERM $pid || kill -KILL $pid; fi;`
|
7
13
|
sleep(1)
|
8
|
-
res = `searchd`
|
9
|
-
puts res
|
10
14
|
end
|
11
15
|
|
12
16
|
# TODO: create configurator method. Template should be like this:
|
data/rt_sphinx.gemspec
CHANGED