mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +02:00
Wait starting fluentd process in #start
This commit is contained in:
parent
94a26c98d6
commit
22d65e0f92
@ -14,7 +14,7 @@ class Fluentd
|
||||
|
||||
def pid
|
||||
return unless File.exists?(pid_file)
|
||||
File.read(pid_file)
|
||||
File.read(pid_file).to_i rescue nil
|
||||
end
|
||||
|
||||
def running?
|
||||
@ -80,7 +80,13 @@ class Fluentd
|
||||
|
||||
def start
|
||||
return if running?
|
||||
spawn("bundle exec fluentd #{options_to_argv}") # TODO
|
||||
spawn("bundle exec fluentd #{options_to_argv}")
|
||||
timeout(5) do # TODO: decide how long wait
|
||||
loop do
|
||||
break if pid && Process.kill(0, pid)
|
||||
sleep 0.01
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def stop
|
||||
|
Loading…
Reference in New Issue
Block a user