fix dialyzer and credo

This commit is contained in:
Graham McIntire 2026-01-11 15:01:57 -06:00
parent 5e1a97fcb3
commit 36175be74e
No known key found for this signature in database
3 changed files with 16 additions and 13 deletions

View file

@ -54,9 +54,10 @@ defmodule ToweropsWeb.Api.AgentController do
Map.get(params, "metrics", [])
end
Task.start(fn ->
process_metrics(agent_token, metrics)
end)
_ =
Task.start(fn ->
process_metrics(agent_token, metrics)
end)
json(conn, %{status: "accepted", received: length(metrics)})
end

View file

@ -46,14 +46,16 @@ defmodule ToweropsWeb.Plugs.AgentAuth do
parent = self()
Task.start(fn ->
# Allow this task to use the test database sandbox
if Application.get_env(:towerops, :sql_sandbox) do
Sandbox.allow(Towerops.Repo, parent, self())
end
_ =
Task.start(fn ->
# Allow this task to use the test database sandbox
_ =
if Application.get_env(:towerops, :sql_sandbox) do
Sandbox.allow(Towerops.Repo, parent, self())
end
Agents.update_agent_token_heartbeat(agent_token.id, ip)
end)
_ = Agents.update_agent_token_heartbeat(agent_token.id, ip)
end)
conn
end

View file

@ -198,15 +198,15 @@ defmodule Towerops.Snmp.Profiles.MikrotikTest do
# Should have temperature sensors
temp_sensors = Enum.filter(sensors, &String.contains?(&1.sensor_type, "temperature"))
assert length(temp_sensors) > 0
assert temp_sensors != []
# Should have voltage sensors
voltage_sensors = Enum.filter(sensors, &String.contains?(&1.sensor_type, "voltage"))
assert length(voltage_sensors) > 0
assert voltage_sensors != []
# Should have fan sensors
fan_sensors = Enum.filter(sensors, &(&1.sensor_type == "fan1"))
assert length(fan_sensors) > 0
assert fan_sensors != []
# Check one sensor in detail
cpu_temp = Enum.find(sensors, &(&1.sensor_type == "cpu_temperature"))