Module: Runes::Janitor
- Defined in:
- lib/runes/janitor.rb
Class Method Summary collapse
-
.es_is_running? ⇒ Boolean
This function was created because rubberband behaves strangely and doesn’t inform properly when elasticsearch isn’t running.
- .setup! ⇒ Object
Class Method Details
.es_is_running? ⇒ Boolean
This function was created because rubberband behaves strangely and doesn’t inform properly when elasticsearch isn’t running.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/runes/janitor.rb', line 19 def es_is_running? require 'socket' if @config.nil? # getting the longer line possible to avoid problems in different operating systems. process_status = system("ps auxwwww | grep org.elasticsearch.bootstrap | grep -v grep >> /dev/null") return process_status else net_status = TCPSocket.open(@config['host'], @config['port'].to_i) if net_status.nil? return false else return true end end end |