towerops/lib/towerops/workers
Graham McIntire d6f7dc570a simplify check skip logic to use runtime checks (#78)
## Summary
- Replace guard-clause-based `should_skip_snmp/service/ping_check?` with a single `should_skip_check?` function using runtime `in` operator checks
- Guard clauses with module attributes (`@service_check_types`) were not working in Dokku buildpack deployments despite code being correct locally
- Also update `CheckWorker` (dead code safety net) to check `device_has_effective_agent?`
- Use `Logger.info` for skip messages so they appear in staging logs

## Context
PR #77 introduced `device_has_effective_agent?/1` and updated all workers, but the guard-clause-based skip functions in `CheckExecutorWorker` weren't matching at runtime on staging despite passing all tests locally. The DNS check kept producing NXDOMAIN errors from Erlang's `:inet_res` resolver.

Root cause: The `when check_type in @service_check_types` guard clause compiled against module attributes appears to have stale evaluation in the Dokku Heroku buildpack release. Moving the check to a runtime function body fixes the issue.

## Test plan
- [x] All 230 worker tests pass
- [x] All 99 agents tests pass
- [x] Verified on staging: "Skipping check eceb3d51... (dns)" appears in info logs
- [x] No new NXDOMAIN results created after deploy

Reviewed-on: graham/towerops-web#78
2026-03-18 19:58:31 -05:00
..
agent_latency_evaluator.ex fix: cloud poller automatic rebalancing 2026-02-12 15:32:33 -06:00
alert_digest_worker.ex fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
alert_notification_worker.ex fix: make sidebar sticky with header and resolve all credo issues (#32) 2026-03-15 18:19:09 -05:00
backup_summary_worker.ex Add strict typespecs to all Oban worker perform/1 functions 2026-02-06 09:50:51 -06:00
backup_timeout_worker.ex Add strict typespecs to all Oban worker perform/1 functions 2026-02-06 09:50:51 -06:00
billing_sync_worker.ex stripe and email after signup 2026-03-06 10:07:27 -06:00
capacity_insight_worker.ex feat: add capacity insight worker, UI, and reporting views 2026-03-07 14:42:40 -06:00
check_executor_worker.ex simplify check skip logic to use runtime checks (#78) 2026-03-18 19:58:31 -05:00
check_worker.ex simplify check skip logic to use runtime checks (#78) 2026-03-18 19:58:31 -05:00
cloud_latency_probe_worker.ex fix: cloud poller automatic rebalancing 2026-02-12 15:32:33 -06:00
cloudflare_ban_worker.ex Add 404-based brute force protection system 2026-02-10 16:31:48 -06:00
cn_maestro_sync_worker.ex paperclip/TOW-21-uisp-integration-phase1 (#31) 2026-03-15 17:57:36 -05:00
device_health_insight_worker.ex feat: command center dashboard with unified insights and contextual enrichment 2026-02-13 14:52:49 -06:00
device_monitor_worker.ex simplify check skip logic to use runtime checks (#78) 2026-03-18 19:58:31 -05:00
device_poller_worker.ex simplify check skip logic to use runtime checks (#78) 2026-03-18 19:58:31 -05:00
discovery_worker.ex skip discovery for devices with snmp disabled (#58) 2026-03-17 11:16:33 -05:00
escalation_check_worker.ex feat: add on-call schedules and escalation policies 2026-03-11 12:32:54 -05:00
expired_ban_cleanup_worker.ex Add 404-based brute force protection system 2026-02-10 16:31:48 -06:00
firmware_version_fetcher_worker.ex Add GeoIP import HTTP tests 2026-03-10 16:02:49 -05:00
gaiia_insight_worker.ex improve Gaiia integration UX 2026-03-12 13:04:17 -05:00
gaiia_sync_worker.ex add gaiia integration stages 1-2: sync engine and entity mapping UI 2026-02-13 10:31:32 -06:00
job_cleanup_task.ex Skip Phoenix poller/monitor scheduling when SNMP disabled 2026-02-17 07:12:15 -06:00
job_health_check_worker.ex fix: dns and ping checks not executing in production (#71) 2026-03-18 08:43:37 -05:00
login_history_cleanup_worker.ex Add strict typespecs to all Oban worker perform/1 functions 2026-02-06 09:50:51 -06:00
mikrotik_backup_worker.ex Add strict typespecs to all Oban worker perform/1 functions 2026-02-06 09:50:51 -06:00
netbox_sync_worker.ex Add NetBox sync worker + improve Gaiia error messages 2026-02-14 17:11:38 -06:00
polling_offset.ex add oban pro 2026-01-26 17:07:42 -06:00
preseem_baseline_worker.ex add preseem insights schema, generation, and queries 2026-02-13 08:53:01 -06:00
preseem_sync_worker.ex stagger preseem sync across organizations 2026-02-13 10:52:32 -06:00
report_worker.ex paperclip/TOW-21-uisp-integration-phase1 (#31) 2026-03-15 17:57:36 -05:00
session_cleanup_worker.ex Add strict typespecs to all Oban worker perform/1 functions 2026-02-06 09:50:51 -06:00
sonar_sync_worker.ex ui: major redesign - NOC dashboard, consolidated nav, dense tables, flat alerts 2026-02-14 20:15:07 -06:00
splynx_sync_worker.ex ui: major redesign - NOC dashboard, consolidated nav, dense tables, flat alerts 2026-02-14 20:15:07 -06:00
stale_agent_worker.ex Add comprehensive typespecs to agent-related modules 2026-02-06 09:33:44 -06:00
stale_violation_cleanup_worker.ex Add 404-based brute force protection system 2026-02-10 16:31:48 -06:00
system_insight_worker.ex fix: improve insight auto-resolution and query performance 2026-03-05 10:11:52 -06:00
uisp_sync_worker.ex paperclip/TOW-21-uisp-integration-phase1 (#31) 2026-03-15 17:57:36 -05:00
visp_sync_worker.ex ui: major redesign - NOC dashboard, consolidated nav, dense tables, flat alerts 2026-02-14 20:15:07 -06:00
weather_sync_worker.ex Prevent Oban polling/monitoring job stacking per device 2026-02-16 16:37:48 -06:00
welcome_email_worker.ex stripe and email after signup 2026-03-06 10:07:27 -06:00
wireless_insight_worker.ex feat: add comprehensive wireless client tracking and monitoring 2026-03-10 09:57:12 -05:00