From 5096ea26694e7fe20d8599120b38729903c6e68f Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 14 Jun 2026 16:38:03 -0500 Subject: [PATCH] credo fixes --- .credo.exs | 4 ++-- lib/towerops/snmp/neighbor_cleanup_worker.ex | 2 +- lib/towerops/workers/agent_latency_evaluator.ex | 2 +- lib/towerops/workers/agent_release_webhook_worker.ex | 2 +- lib/towerops/workers/ai_network_insight_worker.ex | 2 +- lib/towerops/workers/alert_digest_worker.ex | 2 +- lib/towerops/workers/alert_notification_worker.ex | 2 +- lib/towerops/workers/backup_summary_worker.ex | 2 +- lib/towerops/workers/backup_timeout_worker.ex | 2 +- lib/towerops/workers/billing_sync_worker.ex | 2 +- lib/towerops/workers/capacity_insight_worker.ex | 2 +- lib/towerops/workers/check_executor_worker.ex | 2 +- lib/towerops/workers/check_worker.ex | 2 +- lib/towerops/workers/cloud_latency_probe_worker.ex | 2 +- lib/towerops/workers/cloudflare_ban_worker.ex | 2 +- lib/towerops/workers/cn_maestro_sync_worker.ex | 2 +- lib/towerops/workers/coverage_worker.ex | 2 +- lib/towerops/workers/data_retention_worker.ex | 2 +- lib/towerops/workers/device_health_insight_worker.ex | 2 +- lib/towerops/workers/device_monitor_worker.ex | 2 +- lib/towerops/workers/device_poller_worker.ex | 2 +- lib/towerops/workers/discovery_worker.ex | 2 +- lib/towerops/workers/escalation_check_worker.ex | 2 +- lib/towerops/workers/expired_ban_cleanup_worker.ex | 2 +- lib/towerops/workers/firmware_version_fetcher_worker.ex | 2 +- lib/towerops/workers/gaiia_insight_worker.ex | 2 +- lib/towerops/workers/gaiia_sync_worker.ex | 2 +- lib/towerops/workers/gaiia_webhook_worker.ex | 2 +- lib/towerops/workers/insight_expiry_worker.ex | 2 +- lib/towerops/workers/insight_llm_enrichment_worker.ex | 2 +- lib/towerops/workers/job_health_check_worker.ex | 2 +- lib/towerops/workers/lidar_catalog_sync_worker.ex | 2 +- lib/towerops/workers/login_history_cleanup_worker.ex | 2 +- lib/towerops/workers/mikrotik_backup_worker.ex | 2 +- lib/towerops/workers/mikrotik_webhook_worker.ex | 2 +- lib/towerops/workers/ms_buildings_import_worker.ex | 2 +- lib/towerops/workers/netbox_sync_worker.ex | 2 +- lib/towerops/workers/pagerduty_webhook_worker.ex | 2 +- lib/towerops/workers/preseem_baseline_worker.ex | 2 +- lib/towerops/workers/preseem_sync_worker.ex | 2 +- lib/towerops/workers/recommendations_run_worker.ex | 2 +- lib/towerops/workers/report_worker.ex | 2 +- lib/towerops/workers/session_cleanup_worker.ex | 2 +- lib/towerops/workers/sonar_sync_worker.ex | 2 +- lib/towerops/workers/splynx_sync_worker.ex | 2 +- lib/towerops/workers/stale_agent_worker.ex | 2 +- lib/towerops/workers/stale_violation_cleanup_worker.ex | 2 +- lib/towerops/workers/stripe_webhook_worker.ex | 2 +- lib/towerops/workers/system_insight_worker.ex | 2 +- lib/towerops/workers/uisp_sync_worker.ex | 2 +- lib/towerops/workers/visp_sync_worker.ex | 2 +- lib/towerops/workers/weather_sync_worker.ex | 2 +- lib/towerops/workers/welcome_email_worker.ex | 2 +- lib/towerops/workers/wireless_insight_worker.ex | 2 +- 54 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.credo.exs b/.credo.exs index a849a04d..e1f4559e 100644 --- a/.credo.exs +++ b/.credo.exs @@ -197,8 +197,8 @@ [custom_assertion_functions: [:assert_has, :refute_has, :assert_eventually]]}, {Jump.CredoChecks.TooManyAssertions, [max_assertions: 20]}, {Jump.CredoChecks.TopLevelAliasImportRequire}, - {Jump.CredoChecks.UnusedLiveViewAssign, [ignored_assigns: [:active_path, :current_scope, :current_token]]} - # {Jump.CredoChecks.UseObanProWorker}, + {Jump.CredoChecks.UnusedLiveViewAssign, [ignored_assigns: [:active_path, :current_scope, :current_token]]}, + {Jump.CredoChecks.UseObanProWorker} # {Jump.CredoChecks.VacuousTest, # [ # ignore_setup_only_tests?: false, diff --git a/lib/towerops/snmp/neighbor_cleanup_worker.ex b/lib/towerops/snmp/neighbor_cleanup_worker.ex index 39e3cc07..516abd01 100644 --- a/lib/towerops/snmp/neighbor_cleanup_worker.ex +++ b/lib/towerops/snmp/neighbor_cleanup_worker.ex @@ -8,7 +8,7 @@ defmodule Towerops.Snmp.NeighborCleanupWorker do Runs hourly via Oban.Plugins.Cron (configured in application config). """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Devices alias Towerops.Snmp diff --git a/lib/towerops/workers/agent_latency_evaluator.ex b/lib/towerops/workers/agent_latency_evaluator.ex index 0efbcb7c..96c76489 100644 --- a/lib/towerops/workers/agent_latency_evaluator.ex +++ b/lib/towerops/workers/agent_latency_evaluator.ex @@ -12,7 +12,7 @@ defmodule Towerops.Workers.AgentLatencyEvaluator do are never affected. All reassignments use device-level assignments to avoid changing site/org defaults. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Agents alias Towerops.Agents.Stats diff --git a/lib/towerops/workers/agent_release_webhook_worker.ex b/lib/towerops/workers/agent_release_webhook_worker.ex index c1182f3b..8ef18c23 100644 --- a/lib/towerops/workers/agent_release_webhook_worker.ex +++ b/lib/towerops/workers/agent_release_webhook_worker.ex @@ -4,7 +4,7 @@ defmodule Towerops.Workers.AgentReleaseWebhookWorker do webhook controller can ACK the CI sender immediately. """ - use Oban.Worker, queue: :default, max_attempts: 3 + use Oban.Pro.Worker, queue: :default, max_attempts: 3 alias Towerops.Agents diff --git a/lib/towerops/workers/ai_network_insight_worker.ex b/lib/towerops/workers/ai_network_insight_worker.ex index 66c35f3c..45a82341 100644 --- a/lib/towerops/workers/ai_network_insight_worker.ex +++ b/lib/towerops/workers/ai_network_insight_worker.ex @@ -16,7 +16,7 @@ defmodule Towerops.Workers.AiNetworkInsightWorker do swallowed per-org so one bad org doesn't poison the run. """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 import Ecto.Query diff --git a/lib/towerops/workers/alert_digest_worker.ex b/lib/towerops/workers/alert_digest_worker.ex index 8d164654..ba4c01d8 100644 --- a/lib/towerops/workers/alert_digest_worker.ex +++ b/lib/towerops/workers/alert_digest_worker.ex @@ -7,7 +7,7 @@ defmodule Towerops.Workers.AlertDigestWorker do and enqueues individual delivery jobs - Delivery mode (specific user_id): sends the actual digest to that user """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :notifications, max_attempts: 3 diff --git a/lib/towerops/workers/alert_notification_worker.ex b/lib/towerops/workers/alert_notification_worker.ex index 5af36dae..92824551 100644 --- a/lib/towerops/workers/alert_notification_worker.ex +++ b/lib/towerops/workers/alert_notification_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.AlertNotificationWorker do Handles trigger, acknowledge, and resolve notifications with automatic retries and error tracking. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :notifications, max_attempts: 3, priority: 1 diff --git a/lib/towerops/workers/backup_summary_worker.ex b/lib/towerops/workers/backup_summary_worker.ex index 576a7850..f9b17993 100644 --- a/lib/towerops/workers/backup_summary_worker.ex +++ b/lib/towerops/workers/backup_summary_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.BackupSummaryWorker do were any failed or timed-out backup requests in the past 24 hours. """ - use Oban.Worker, queue: :maintenance, max_attempts: 1 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 1 alias Towerops.Devices.BackupRequests diff --git a/lib/towerops/workers/backup_timeout_worker.ex b/lib/towerops/workers/backup_timeout_worker.ex index 936dec84..15824601 100644 --- a/lib/towerops/workers/backup_timeout_worker.ex +++ b/lib/towerops/workers/backup_timeout_worker.ex @@ -7,7 +7,7 @@ defmodule Towerops.Workers.BackupTimeoutWorker do from accumulating stale entries. """ - use Oban.Worker, queue: :maintenance, max_attempts: 1 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 1 alias Towerops.Devices.BackupRequests diff --git a/lib/towerops/workers/billing_sync_worker.ex b/lib/towerops/workers/billing_sync_worker.ex index 12a658cd..c3d8b690 100644 --- a/lib/towerops/workers/billing_sync_worker.ex +++ b/lib/towerops/workers/billing_sync_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.BillingSyncWorker do Runs at 3 AM UTC daily via Oban cron. """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 alias Towerops.Billing alias Towerops.Organizations diff --git a/lib/towerops/workers/capacity_insight_worker.ex b/lib/towerops/workers/capacity_insight_worker.ex index 4bd05590..78e301ae 100644 --- a/lib/towerops/workers/capacity_insight_worker.ex +++ b/lib/towerops/workers/capacity_insight_worker.ex @@ -10,7 +10,7 @@ defmodule Towerops.Workers.CapacityInsightWorker do Auto-resolves insights when utilization drops below 70%. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/check_executor_worker.ex b/lib/towerops/workers/check_executor_worker.ex index c154e7df..4a3d94ad 100644 --- a/lib/towerops/workers/check_executor_worker.ex +++ b/lib/towerops/workers/check_executor_worker.ex @@ -25,7 +25,7 @@ defmodule Towerops.Workers.CheckExecutorWorker do # accumulate without bound. `:executing` is deliberately excluded: perform/1 # self-schedules the next run while the current job is still executing, and # including it would make that reschedule conflict with itself. - use Oban.Worker, + use Oban.Pro.Worker, queue: :check_executors, max_attempts: 3, unique: [ diff --git a/lib/towerops/workers/check_worker.ex b/lib/towerops/workers/check_worker.ex index 63282273..d9e1a169 100644 --- a/lib/towerops/workers/check_worker.ex +++ b/lib/towerops/workers/check_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.CheckWorker do Follows same self-scheduling pattern as DeviceMonitorWorker. Phoenix executes checks unless assigned to an agent (agent_token_id set). """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :checks, unique: [ period: 60, diff --git a/lib/towerops/workers/cloud_latency_probe_worker.ex b/lib/towerops/workers/cloud_latency_probe_worker.ex index 7cc7f32d..874edb5c 100644 --- a/lib/towerops/workers/cloud_latency_probe_worker.ex +++ b/lib/towerops/workers/cloud_latency_probe_worker.ex @@ -9,7 +9,7 @@ defmodule Towerops.Workers.CloudLatencyProbeWorker do Each cloud agent receives a list of devices to ping (5 pings per device). Results flow back through the existing MonitoringCheck pipeline. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Agents diff --git a/lib/towerops/workers/cloudflare_ban_worker.ex b/lib/towerops/workers/cloudflare_ban_worker.ex index d44fe46b..a116df11 100644 --- a/lib/towerops/workers/cloudflare_ban_worker.ex +++ b/lib/towerops/workers/cloudflare_ban_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.CloudflareBanWorker do Runs in the :maintenance queue with up to 3 retry attempts. """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 alias Towerops.Security.CloudflareClient diff --git a/lib/towerops/workers/cn_maestro_sync_worker.ex b/lib/towerops/workers/cn_maestro_sync_worker.ex index 577414ec..4d4f10cb 100644 --- a/lib/towerops/workers/cn_maestro_sync_worker.ex +++ b/lib/towerops/workers/cn_maestro_sync_worker.ex @@ -4,7 +4,7 @@ defmodule Towerops.Workers.CnMaestroSyncWorker do Same pattern as UispSyncWorker: cron dispatcher + staggered individual jobs. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.CnMaestro.Sync alias Towerops.Integrations diff --git a/lib/towerops/workers/coverage_worker.ex b/lib/towerops/workers/coverage_worker.ex index f7e08f1e..eb124bcb 100644 --- a/lib/towerops/workers/coverage_worker.ex +++ b/lib/towerops/workers/coverage_worker.ex @@ -23,7 +23,7 @@ defmodule Towerops.Workers.CoverageWorker do # max_attempts: 1 — `fail/2` returns :ok and writes the failure onto the # coverage row itself, so there's nothing for Oban to retry. The previous # max_attempts: 3 implied retries that never actually happened. - use Oban.Worker, + use Oban.Pro.Worker, queue: :coverage, max_attempts: 1, unique: [ diff --git a/lib/towerops/workers/data_retention_worker.ex b/lib/towerops/workers/data_retention_worker.ex index 3e26f3c6..d094293f 100644 --- a/lib/towerops/workers/data_retention_worker.ex +++ b/lib/towerops/workers/data_retention_worker.ex @@ -17,7 +17,7 @@ defmodule Towerops.Workers.DataRetentionWorker do TimescaleDB global retention (730 days) acts as a safety net. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Repo diff --git a/lib/towerops/workers/device_health_insight_worker.ex b/lib/towerops/workers/device_health_insight_worker.ex index 36466747..04d584cf 100644 --- a/lib/towerops/workers/device_health_insight_worker.ex +++ b/lib/towerops/workers/device_health_insight_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.DeviceHealthInsightWorker do Runs nightly to detect: - `device_poll_gap`: Devices not polled in over 24 hours """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/device_monitor_worker.ex b/lib/towerops/workers/device_monitor_worker.ex index b320ce93..aea87fd3 100644 --- a/lib/towerops/workers/device_monitor_worker.ex +++ b/lib/towerops/workers/device_monitor_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.DeviceMonitorWorker do runs cluster-wide. Monitors check device connectivity and create alerts on status changes. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :monitors, max_attempts: 1, unique: [ diff --git a/lib/towerops/workers/device_poller_worker.ex b/lib/towerops/workers/device_poller_worker.ex index 03a03dbd..fa22c2b5 100644 --- a/lib/towerops/workers/device_poller_worker.ex +++ b/lib/towerops/workers/device_poller_worker.ex @@ -12,7 +12,7 @@ defmodule Towerops.Workers.DevicePollerWorker do Uses Oban's unique job feature to ensure only one poller per device runs cluster-wide. Poll interval is configurable per device (default: 60 seconds). """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :pollers, max_attempts: 1, unique: [ diff --git a/lib/towerops/workers/discovery_worker.ex b/lib/towerops/workers/discovery_worker.ex index a3d27559..dc919e1c 100644 --- a/lib/towerops/workers/discovery_worker.ex +++ b/lib/towerops/workers/discovery_worker.ex @@ -16,7 +16,7 @@ defmodule Towerops.Workers.DiscoveryWorker do If no agent is assigned or the agent is offline, discovery falls back to direct SNMP operations from the Phoenix cluster. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :discovery, unique: [period: 60, states: [:available, :scheduled, :executing, :suspended, :retryable]], max_attempts: 3 diff --git a/lib/towerops/workers/escalation_check_worker.ex b/lib/towerops/workers/escalation_check_worker.ex index 6008c02c..eeed8016 100644 --- a/lib/towerops/workers/escalation_check_worker.ex +++ b/lib/towerops/workers/escalation_check_worker.ex @@ -3,7 +3,7 @@ defmodule Towerops.Workers.EscalationCheckWorker do Oban worker that checks if an on-call incident needs to escalate to the next rule after the timeout period. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :notifications, max_attempts: 3, priority: 1 diff --git a/lib/towerops/workers/expired_ban_cleanup_worker.ex b/lib/towerops/workers/expired_ban_cleanup_worker.ex index 23bcedce..ef358fbf 100644 --- a/lib/towerops/workers/expired_ban_cleanup_worker.ex +++ b/lib/towerops/workers/expired_ban_cleanup_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.ExpiredBanCleanupWorker do Permanent bans (nil `banned_until`) are not affected. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Security.BruteForce diff --git a/lib/towerops/workers/firmware_version_fetcher_worker.ex b/lib/towerops/workers/firmware_version_fetcher_worker.ex index 6eb3a8a9..fcd2a855 100644 --- a/lib/towerops/workers/firmware_version_fetcher_worker.ex +++ b/lib/towerops/workers/firmware_version_fetcher_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.FirmwareVersionFetcherWorker do Runs daily to check for new firmware releases and updates the firmware_releases table. """ - use Oban.Worker, queue: :maintenance, max_attempts: 10 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 10 import SweetXml diff --git a/lib/towerops/workers/gaiia_insight_worker.ex b/lib/towerops/workers/gaiia_insight_worker.ex index 4a6a1ed7..f37849a5 100644 --- a/lib/towerops/workers/gaiia_insight_worker.ex +++ b/lib/towerops/workers/gaiia_insight_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.GaiiaInsightWorker do Runs nightly to detect: - `reconciliation_finding`: Untracked devices, ghost devices, data mismatches """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance use Gettext, backend: ToweropsWeb.Gettext import Ecto.Query diff --git a/lib/towerops/workers/gaiia_sync_worker.ex b/lib/towerops/workers/gaiia_sync_worker.ex index ce2b8acb..fcb63845 100644 --- a/lib/towerops/workers/gaiia_sync_worker.ex +++ b/lib/towerops/workers/gaiia_sync_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.GaiiaSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Gaiia.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Gaiia.Sync alias Towerops.Integrations diff --git a/lib/towerops/workers/gaiia_webhook_worker.ex b/lib/towerops/workers/gaiia_webhook_worker.ex index 5b9355cb..3601ba99 100644 --- a/lib/towerops/workers/gaiia_webhook_worker.ex +++ b/lib/towerops/workers/gaiia_webhook_worker.ex @@ -4,7 +4,7 @@ defmodule Towerops.Workers.GaiiaWebhookWorker do the webhook sender immediately. """ - use Oban.Worker, queue: :default, max_attempts: 3 + use Oban.Pro.Worker, queue: :default, max_attempts: 3 alias Towerops.Gaiia.Webhooks diff --git a/lib/towerops/workers/insight_expiry_worker.ex b/lib/towerops/workers/insight_expiry_worker.ex index 0bd0508e..8eca7ccd 100644 --- a/lib/towerops/workers/insight_expiry_worker.ex +++ b/lib/towerops/workers/insight_expiry_worker.ex @@ -16,7 +16,7 @@ defmodule Towerops.Workers.InsightExpiryWorker do max_age_days: 14 """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 import Ecto.Query diff --git a/lib/towerops/workers/insight_llm_enrichment_worker.ex b/lib/towerops/workers/insight_llm_enrichment_worker.ex index eb6819e3..37c00007 100644 --- a/lib/towerops/workers/insight_llm_enrichment_worker.ex +++ b/lib/towerops/workers/insight_llm_enrichment_worker.ex @@ -8,7 +8,7 @@ defmodule Towerops.Workers.InsightLlmEnrichmentWorker do in the UI, just without a plain-language summary. """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 alias Towerops.LLM alias Towerops.LLM.InsightPrompt diff --git a/lib/towerops/workers/job_health_check_worker.ex b/lib/towerops/workers/job_health_check_worker.ex index 07bf8647..68a5a11b 100644 --- a/lib/towerops/workers/job_health_check_worker.ex +++ b/lib/towerops/workers/job_health_check_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.JobHealthCheckWorker do This handles edge cases where jobs might get cancelled unexpectedly or database inconsistencies occur during deployments or pod failures. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/lidar_catalog_sync_worker.ex b/lib/towerops/workers/lidar_catalog_sync_worker.ex index 1208d38d..3ec69052 100644 --- a/lib/towerops/workers/lidar_catalog_sync_worker.ex +++ b/lib/towerops/workers/lidar_catalog_sync_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.LidarCatalogSyncWorker do Runs monthly via cron. Discovers Texas LIDAR projects on USGS 3DEP and upserts tile metadata into `lidar_tiles`. Does not download raster data. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :lidar, unique: [period: 86_400, states: [:available, :scheduled, :executing, :suspended, :retryable]] diff --git a/lib/towerops/workers/login_history_cleanup_worker.ex b/lib/towerops/workers/login_history_cleanup_worker.ex index e2135f04..55b9158f 100644 --- a/lib/towerops/workers/login_history_cleanup_worker.ex +++ b/lib/towerops/workers/login_history_cleanup_worker.ex @@ -8,7 +8,7 @@ defmodule Towerops.Workers.LoginHistoryCleanupWorker do This worker runs daily at 2 AM via Oban cron. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/mikrotik_backup_worker.ex b/lib/towerops/workers/mikrotik_backup_worker.ex index b516e5a5..eb93c65a 100644 --- a/lib/towerops/workers/mikrotik_backup_worker.ex +++ b/lib/towerops/workers/mikrotik_backup_worker.ex @@ -12,7 +12,7 @@ defmodule Towerops.Workers.MikrotikBackupWorker do - Are assigned to an agent """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 alias Towerops.Devices alias Towerops.Devices.BackupRequests diff --git a/lib/towerops/workers/mikrotik_webhook_worker.ex b/lib/towerops/workers/mikrotik_webhook_worker.ex index f3abd68b..0085b187 100644 --- a/lib/towerops/workers/mikrotik_webhook_worker.ex +++ b/lib/towerops/workers/mikrotik_webhook_worker.ex @@ -16,7 +16,7 @@ defmodule Towerops.Workers.MikrotikWebhookWorker do later. """ - use Oban.Worker, queue: :default, max_attempts: 5 + use Oban.Pro.Worker, queue: :default, max_attempts: 5 alias Towerops.Mikrotik alias Towerops.Mikrotik.GaiiaResolver diff --git a/lib/towerops/workers/ms_buildings_import_worker.ex b/lib/towerops/workers/ms_buildings_import_worker.ex index 2c0c036a..e23e676d 100644 --- a/lib/towerops/workers/ms_buildings_import_worker.ex +++ b/lib/towerops/workers/ms_buildings_import_worker.ex @@ -22,7 +22,7 @@ defmodule Towerops.Workers.MsBuildingsImportWorker do we hash the geometry's bounding box so re-running with the same data is a no-op. """ - use Oban.Worker, queue: :default, max_attempts: 1 + use Oban.Pro.Worker, queue: :default, max_attempts: 1 alias Towerops.Coverages.Building alias Towerops.Repo diff --git a/lib/towerops/workers/netbox_sync_worker.ex b/lib/towerops/workers/netbox_sync_worker.ex index 4ebc88be..e60324ee 100644 --- a/lib/towerops/workers/netbox_sync_worker.ex +++ b/lib/towerops/workers/netbox_sync_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.NetBoxSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `NetBox.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.NetBox.Sync diff --git a/lib/towerops/workers/pagerduty_webhook_worker.ex b/lib/towerops/workers/pagerduty_webhook_worker.ex index 952ff86d..cb16947a 100644 --- a/lib/towerops/workers/pagerduty_webhook_worker.ex +++ b/lib/towerops/workers/pagerduty_webhook_worker.ex @@ -4,7 +4,7 @@ defmodule Towerops.Workers.PagerdutyWebhookWorker do the webhook sender immediately. """ - use Oban.Worker, queue: :default, max_attempts: 3 + use Oban.Pro.Worker, queue: :default, max_attempts: 3 alias Towerops.Alerts diff --git a/lib/towerops/workers/preseem_baseline_worker.ex b/lib/towerops/workers/preseem_baseline_worker.ex index 38ca8c84..19eb1690 100644 --- a/lib/towerops/workers/preseem_baseline_worker.ex +++ b/lib/towerops/workers/preseem_baseline_worker.ex @@ -3,7 +3,7 @@ defmodule Towerops.Workers.PreseemBaselineWorker do Nightly Oban cron worker that computes device baselines and fleet profiles for all organizations with enabled Preseem integrations. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Preseem.Baseline diff --git a/lib/towerops/workers/preseem_sync_worker.ex b/lib/towerops/workers/preseem_sync_worker.ex index 62209e47..bcb178b8 100644 --- a/lib/towerops/workers/preseem_sync_worker.ex +++ b/lib/towerops/workers/preseem_sync_worker.ex @@ -10,7 +10,7 @@ defmodule Towerops.Workers.PreseemSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Preseem.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Preseem.Sync diff --git a/lib/towerops/workers/recommendations_run_worker.ex b/lib/towerops/workers/recommendations_run_worker.ex index 9b84eccd..92cb56af 100644 --- a/lib/towerops/workers/recommendations_run_worker.ex +++ b/lib/towerops/workers/recommendations_run_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.RecommendationsRunWorker do `evaluate(organization_id) :: [insight_attrs]`. """ - use Oban.Worker, queue: :maintenance, max_attempts: 3 + use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3 import Ecto.Query diff --git a/lib/towerops/workers/report_worker.ex b/lib/towerops/workers/report_worker.ex index ea40c73d..8e53f6b0 100644 --- a/lib/towerops/workers/report_worker.ex +++ b/lib/towerops/workers/report_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.ReportWorker do The cron dispatcher (no args) runs hourly and checks which reports are due. Individual jobs receive `%{"report_id" => id}` and generate + email the report. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Reports alias Towerops.Reports.Notifier diff --git a/lib/towerops/workers/session_cleanup_worker.ex b/lib/towerops/workers/session_cleanup_worker.ex index 695a724a..5b610973 100644 --- a/lib/towerops/workers/session_cleanup_worker.ex +++ b/lib/towerops/workers/session_cleanup_worker.ex @@ -5,7 +5,7 @@ defmodule Towerops.Workers.SessionCleanupWorker do Deletes browser sessions that have passed their expiration timestamp. This worker runs daily at 3 AM via Oban cron. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Accounts diff --git a/lib/towerops/workers/sonar_sync_worker.ex b/lib/towerops/workers/sonar_sync_worker.ex index 4a2e2f49..e57b53d7 100644 --- a/lib/towerops/workers/sonar_sync_worker.ex +++ b/lib/towerops/workers/sonar_sync_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.SonarSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Sonar.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Sonar.Sync diff --git a/lib/towerops/workers/splynx_sync_worker.ex b/lib/towerops/workers/splynx_sync_worker.ex index 25734056..aafe7b89 100644 --- a/lib/towerops/workers/splynx_sync_worker.ex +++ b/lib/towerops/workers/splynx_sync_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.SplynxSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Splynx.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Splynx.Sync diff --git a/lib/towerops/workers/stale_agent_worker.ex b/lib/towerops/workers/stale_agent_worker.ex index e14e7dc5..13bd2dc2 100644 --- a/lib/towerops/workers/stale_agent_worker.ex +++ b/lib/towerops/workers/stale_agent_worker.ex @@ -12,7 +12,7 @@ defmodule Towerops.Workers.StaleAgentWorker do - They have checked in at least once (last_seen_at is not nil) - They haven't checked in for more than 10 minutes """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/stale_violation_cleanup_worker.ex b/lib/towerops/workers/stale_violation_cleanup_worker.ex index d38578a4..2da02b27 100644 --- a/lib/towerops/workers/stale_violation_cleanup_worker.ex +++ b/lib/towerops/workers/stale_violation_cleanup_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.StaleViolationCleanupWorker do Permanent bans are retained indefinitely for audit purposes. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Security.BruteForce diff --git a/lib/towerops/workers/stripe_webhook_worker.ex b/lib/towerops/workers/stripe_webhook_worker.ex index ea9f030a..5c19c5cb 100644 --- a/lib/towerops/workers/stripe_webhook_worker.ex +++ b/lib/towerops/workers/stripe_webhook_worker.ex @@ -4,7 +4,7 @@ defmodule Towerops.Workers.StripeWebhookWorker do the webhook sender immediately. """ - use Oban.Worker, queue: :default, max_attempts: 3 + use Oban.Pro.Worker, queue: :default, max_attempts: 3 alias Towerops.Billing.WebhookProcessor diff --git a/lib/towerops/workers/system_insight_worker.ex b/lib/towerops/workers/system_insight_worker.ex index 3e72559e..2f57fd8a 100644 --- a/lib/towerops/workers/system_insight_worker.ex +++ b/lib/towerops/workers/system_insight_worker.ex @@ -6,7 +6,7 @@ defmodule Towerops.Workers.SystemInsightWorker do - `agent_offline`: Agents not seen in over 10 minutes - Auto-resolves agent_offline insights when agents come back online """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query diff --git a/lib/towerops/workers/uisp_sync_worker.ex b/lib/towerops/workers/uisp_sync_worker.ex index 8c35faf0..94f967cd 100644 --- a/lib/towerops/workers/uisp_sync_worker.ex +++ b/lib/towerops/workers/uisp_sync_worker.ex @@ -10,7 +10,7 @@ defmodule Towerops.Workers.UispSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Uisp.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Uisp.Sync diff --git a/lib/towerops/workers/visp_sync_worker.ex b/lib/towerops/workers/visp_sync_worker.ex index bdb8b227..8edadd2c 100644 --- a/lib/towerops/workers/visp_sync_worker.ex +++ b/lib/towerops/workers/visp_sync_worker.ex @@ -11,7 +11,7 @@ defmodule Towerops.Workers.VispSyncWorker do Individual jobs receive `%{"integration_id" => id}` and perform the actual sync via `Visp.Sync.sync_organization/1`. """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance alias Towerops.Integrations alias Towerops.Visp.Sync diff --git a/lib/towerops/workers/weather_sync_worker.ex b/lib/towerops/workers/weather_sync_worker.ex index 6e6f734b..00229a8f 100644 --- a/lib/towerops/workers/weather_sync_worker.ex +++ b/lib/towerops/workers/weather_sync_worker.ex @@ -7,7 +7,7 @@ defmodule Towerops.Workers.WeatherSyncWorker do Also cleans up observations older than 30 days on each run. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :weather, unique: [period: 600, states: [:available, :scheduled, :executing, :suspended, :retryable]] diff --git a/lib/towerops/workers/welcome_email_worker.ex b/lib/towerops/workers/welcome_email_worker.ex index 459b66e4..9aafa0cc 100644 --- a/lib/towerops/workers/welcome_email_worker.ex +++ b/lib/towerops/workers/welcome_email_worker.ex @@ -2,7 +2,7 @@ defmodule Towerops.Workers.WelcomeEmailWorker do @moduledoc """ Sends a welcome email to new users a few minutes after registration. """ - use Oban.Worker, + use Oban.Pro.Worker, queue: :notifications, max_attempts: 3 diff --git a/lib/towerops/workers/wireless_insight_worker.ex b/lib/towerops/workers/wireless_insight_worker.ex index baeaead5..693c4afc 100644 --- a/lib/towerops/workers/wireless_insight_worker.ex +++ b/lib/towerops/workers/wireless_insight_worker.ex @@ -10,7 +10,7 @@ defmodule Towerops.Workers.WirelessInsightWorker do Auto-resolves insights when conditions improve (with hysteresis to prevent flapping). """ - use Oban.Worker, queue: :maintenance + use Oban.Pro.Worker, queue: :maintenance import Ecto.Query