pull/554/head
parent
9bfb7a8d78
commit
78b33d7621
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue