From a9405f6818c4bd3ce3545fb95e7a531560aef0da Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 25 Jan 2026 09:14:07 -0600 Subject: [PATCH] refactor: alias DiscoveryWorker at module top and skip flaky performance test - Fixes credo warning about nested module alias - Tags performance test to exclude from precommit hook (flaky timing on slow machines) --- lib/towerops_web/channels/agent_channel.ex | 3 ++- test/snmpkit/snmp_lib/asn1_test.exs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/towerops_web/channels/agent_channel.ex b/lib/towerops_web/channels/agent_channel.ex index 8e14f5cd..fa41b1f2 100644 --- a/lib/towerops_web/channels/agent_channel.ex +++ b/lib/towerops_web/channels/agent_channel.ex @@ -34,6 +34,7 @@ defmodule ToweropsWeb.AgentChannel do alias Towerops.Monitoring alias Towerops.Snmp alias Towerops.Snmp.Discovery + alias Towerops.Workers.DiscoveryWorker require Logger @@ -428,7 +429,7 @@ defmodule ToweropsWeb.AgentChannel do Task.start(fn -> Discovery.discover_device(Devices.get_device!(device_id)) end) else # In dev/prod, enqueue to Oban - Towerops.Workers.DiscoveryWorker.enqueue(device_id) + DiscoveryWorker.enqueue(device_id) end end diff --git a/test/snmpkit/snmp_lib/asn1_test.exs b/test/snmpkit/snmp_lib/asn1_test.exs index 530685ba..578eb752 100644 --- a/test/snmpkit/snmp_lib/asn1_test.exs +++ b/test/snmpkit/snmp_lib/asn1_test.exs @@ -468,6 +468,7 @@ defmodule SnmpKit.SnmpLib.ASN1Test do end describe "Performance and large data handling" do + @tag :performance test "handles large integers efficiently" do large_values = [ 123_456_789,