Debug AMQP/connectivity issues

pull/1163/head
Rick Carlino 2019-04-17 15:42:50 -07:00
parent e032acddfd
commit 3681aeb33b
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ class LogService
def self.process(delivery_info, payload)
params = { routing_key: delivery_info.routing_key, payload: payload }
data = AmqpLogParser.run!(params)
puts data.payload["message"] if Rails.env.production?
if Rails.env.production?
msg = data.payload["message"]
l = "#{delivery_info.routing_key} => #{msg}"
puts l if !msg.starts_with?("R") # Filter GCode
end
THROTTLE_POLICY.track(data.device_id)
maybe_deliver(data)
end