Farmbot-Web-App/lib/log_service.rb
2018-01-14 08:01:37 -06:00

14 lines
362 B
Ruby

require_relative "./log_service_support"
begin
# Listen to all logs on the message broker and store them in the database.
Transport
.log_channel
.subscribe(block: true) { |info, _, payl| LogService.process(info, payl) }
rescue => Bunny::TCPConnectionFailedForAllHosts
puts "MQTT Broker is unreachable. Waiting 5 seconds..."
sleep 5
retry
end