fix dialyzer and credo
This commit is contained in:
parent
5e1a97fcb3
commit
36175be74e
3 changed files with 16 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue