Method: Flydata::Command::Sender#start
- Defined in:
- lib/flydata/command/sender.rb
#start(options_or_show_final_message = {show_final_message: true}) ⇒ Object
For backward compatibility. Use only as options going forward
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/flydata/command/sender.rb', line 9 def start( = {show_final_message: true}) # For backward compatibility. Use only as options going forward if .kind_of? Hash = else = {show_final_message: } end # Check if process exist if process_exist? say("Process is still running. Please stop process first.") unless [:quiet] return end wait_until_server_ready() # Start sender(fluentd) process say('Starting sender process.') unless [:quiet] Dir.chdir(FLYDATA_HOME){ daemon_option = opts.no_daemon? ? "" : "-d #{FLYDATA_HOME}/flydata.pid" Kernel.system("fluentd #{daemon_option} -l #{FLYDATA_HOME}/flydata.log -c #{FLYDATA_HOME}/flydata.conf -p #{File.dirname(__FILE__)}/../fluent-plugins") } Kernel.sleep 5 wait_until_client_ready() #wait_until_logs_uploaded if [:show_final_message] && ![:quiet] data_port = flydata.data_port.get say("Go to your Dashboard! #{flydata.flydata_api_host}/data_ports/#{data_port['id']}") say "Please Note: Records and Total Size are updated every 10-20 minutes.\n" end end |