pull/554/head
Rick Carlino 2017-12-06 12:31:39 -06:00
parent 9bfb7a8d78
commit 78b33d7621
1 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
Transport
.log_channel
.subscribe(block: true) do |delivery_info, properties, payload|
# Legacy FBOS still uses the API for log storage.
headers = properties[:headers] || {}
# Guess version
not_legacy = !headers.keys.join(" ").include?("mqtt")
if (not_legacy)
# # Legacy FBOS still uses the API for log storage.
# headers = properties[:headers] || {}
# # Guess version
# not_legacy = !headers.keys.join(" ").include?("mqtt")
# if (not_legacy)
# Extract current user (if version is appropriate)
device_id = delivery_info.routing_key.split(".")[1].gsub("device_", "").to_i
device = Device.find(device_id)
@ -13,5 +13,5 @@ Transport
payload = JSON.parse(payload)
puts "===== INCOMING LOG ====="
puts payload
end
# end
end