nerves-hub / nerves_hub_web

Manage firmware updates for Nerves devices
https://nerves-hub.org/
Apache License 2.0
198 stars 69 forks source link

Empty metrics report gets treated as an error #1662

Open elinol opened 6 hours ago

elinol commented 6 hours ago

When a device is reporting health with an empty metrics map, it gets treated as an error and triggers Logger.warning("Failed to save metrics").

See matching on result of Repo.insert_all in Metrics.save_metrics:

case results do
      {0, _} -> :error
      {count, _} -> {:ok, count}
 end