credo fixes

This commit is contained in:
Graham McIntire 2026-06-14 16:38:03 -05:00
parent 5e2a3c229e
commit 5096ea2669
54 changed files with 55 additions and 55 deletions

View file

@ -197,8 +197,8 @@
[custom_assertion_functions: [:assert_has, :refute_has, :assert_eventually]]}, [custom_assertion_functions: [:assert_has, :refute_has, :assert_eventually]]},
{Jump.CredoChecks.TooManyAssertions, [max_assertions: 20]}, {Jump.CredoChecks.TooManyAssertions, [max_assertions: 20]},
{Jump.CredoChecks.TopLevelAliasImportRequire}, {Jump.CredoChecks.TopLevelAliasImportRequire},
{Jump.CredoChecks.UnusedLiveViewAssign, [ignored_assigns: [:active_path, :current_scope, :current_token]]} {Jump.CredoChecks.UnusedLiveViewAssign, [ignored_assigns: [:active_path, :current_scope, :current_token]]},
# {Jump.CredoChecks.UseObanProWorker}, {Jump.CredoChecks.UseObanProWorker}
# {Jump.CredoChecks.VacuousTest, # {Jump.CredoChecks.VacuousTest,
# [ # [
# ignore_setup_only_tests?: false, # ignore_setup_only_tests?: false,

View file

@ -8,7 +8,7 @@ defmodule Towerops.Snmp.NeighborCleanupWorker do
Runs hourly via Oban.Plugins.Cron (configured in application config). 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.Devices
alias Towerops.Snmp alias Towerops.Snmp

View file

@ -12,7 +12,7 @@ defmodule Towerops.Workers.AgentLatencyEvaluator do
are never affected. All reassignments use device-level assignments to avoid are never affected. All reassignments use device-level assignments to avoid
changing site/org defaults. changing site/org defaults.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Agents alias Towerops.Agents
alias Towerops.Agents.Stats alias Towerops.Agents.Stats

View file

@ -4,7 +4,7 @@ defmodule Towerops.Workers.AgentReleaseWebhookWorker do
webhook controller can ACK the CI sender immediately. 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 alias Towerops.Agents

View file

@ -16,7 +16,7 @@ defmodule Towerops.Workers.AiNetworkInsightWorker do
swallowed per-org so one bad org doesn't poison the run. 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 import Ecto.Query

View file

@ -7,7 +7,7 @@ defmodule Towerops.Workers.AlertDigestWorker do
and enqueues individual delivery jobs and enqueues individual delivery jobs
- Delivery mode (specific user_id): sends the actual digest to that user - Delivery mode (specific user_id): sends the actual digest to that user
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :notifications, queue: :notifications,
max_attempts: 3 max_attempts: 3

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.AlertNotificationWorker do
Handles trigger, acknowledge, and resolve notifications with automatic Handles trigger, acknowledge, and resolve notifications with automatic
retries and error tracking. retries and error tracking.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :notifications, queue: :notifications,
max_attempts: 3, max_attempts: 3,
priority: 1 priority: 1

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.BackupSummaryWorker do
were any failed or timed-out backup requests in the past 24 hours. 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 alias Towerops.Devices.BackupRequests

View file

@ -7,7 +7,7 @@ defmodule Towerops.Workers.BackupTimeoutWorker do
from accumulating stale entries. 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 alias Towerops.Devices.BackupRequests

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.BillingSyncWorker do
Runs at 3 AM UTC daily via Oban cron. 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.Billing
alias Towerops.Organizations alias Towerops.Organizations

View file

@ -10,7 +10,7 @@ defmodule Towerops.Workers.CapacityInsightWorker do
Auto-resolves insights when utilization drops below 70%. Auto-resolves insights when utilization drops below 70%.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -25,7 +25,7 @@ defmodule Towerops.Workers.CheckExecutorWorker do
# accumulate without bound. `:executing` is deliberately excluded: perform/1 # accumulate without bound. `:executing` is deliberately excluded: perform/1
# self-schedules the next run while the current job is still executing, and # self-schedules the next run while the current job is still executing, and
# including it would make that reschedule conflict with itself. # including it would make that reschedule conflict with itself.
use Oban.Worker, use Oban.Pro.Worker,
queue: :check_executors, queue: :check_executors,
max_attempts: 3, max_attempts: 3,
unique: [ unique: [

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.CheckWorker do
Follows same self-scheduling pattern as DeviceMonitorWorker. Follows same self-scheduling pattern as DeviceMonitorWorker.
Phoenix executes checks unless assigned to an agent (agent_token_id set). Phoenix executes checks unless assigned to an agent (agent_token_id set).
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :checks, queue: :checks,
unique: [ unique: [
period: 60, period: 60,

View file

@ -9,7 +9,7 @@ defmodule Towerops.Workers.CloudLatencyProbeWorker do
Each cloud agent receives a list of devices to ping (5 pings per device). Each cloud agent receives a list of devices to ping (5 pings per device).
Results flow back through the existing MonitoringCheck pipeline. Results flow back through the existing MonitoringCheck pipeline.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Agents alias Towerops.Agents

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.CloudflareBanWorker do
Runs in the :maintenance queue with up to 3 retry attempts. 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 alias Towerops.Security.CloudflareClient

View file

@ -4,7 +4,7 @@ defmodule Towerops.Workers.CnMaestroSyncWorker do
Same pattern as UispSyncWorker: cron dispatcher + staggered individual jobs. 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.CnMaestro.Sync
alias Towerops.Integrations alias Towerops.Integrations

View file

@ -23,7 +23,7 @@ defmodule Towerops.Workers.CoverageWorker do
# max_attempts: 1 — `fail/2` returns :ok and writes the failure onto the # 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 # coverage row itself, so there's nothing for Oban to retry. The previous
# max_attempts: 3 implied retries that never actually happened. # max_attempts: 3 implied retries that never actually happened.
use Oban.Worker, use Oban.Pro.Worker,
queue: :coverage, queue: :coverage,
max_attempts: 1, max_attempts: 1,
unique: [ unique: [

View file

@ -17,7 +17,7 @@ defmodule Towerops.Workers.DataRetentionWorker do
TimescaleDB global retention (730 days) acts as a safety net. TimescaleDB global retention (730 days) acts as a safety net.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Repo alias Towerops.Repo

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.DeviceHealthInsightWorker do
Runs nightly to detect: Runs nightly to detect:
- `device_poll_gap`: Devices not polled in over 24 hours - `device_poll_gap`: Devices not polled in over 24 hours
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.DeviceMonitorWorker do
runs cluster-wide. Monitors check device connectivity and create alerts runs cluster-wide. Monitors check device connectivity and create alerts
on status changes. on status changes.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :monitors, queue: :monitors,
max_attempts: 1, max_attempts: 1,
unique: [ unique: [

View file

@ -12,7 +12,7 @@ defmodule Towerops.Workers.DevicePollerWorker do
Uses Oban's unique job feature to ensure only one poller per device 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). runs cluster-wide. Poll interval is configurable per device (default: 60 seconds).
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :pollers, queue: :pollers,
max_attempts: 1, max_attempts: 1,
unique: [ unique: [

View file

@ -16,7 +16,7 @@ defmodule Towerops.Workers.DiscoveryWorker do
If no agent is assigned or the agent is offline, discovery falls back to direct If no agent is assigned or the agent is offline, discovery falls back to direct
SNMP operations from the Phoenix cluster. SNMP operations from the Phoenix cluster.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :discovery, queue: :discovery,
unique: [period: 60, states: [:available, :scheduled, :executing, :suspended, :retryable]], unique: [period: 60, states: [:available, :scheduled, :executing, :suspended, :retryable]],
max_attempts: 3 max_attempts: 3

View file

@ -3,7 +3,7 @@ defmodule Towerops.Workers.EscalationCheckWorker do
Oban worker that checks if an on-call incident needs to escalate Oban worker that checks if an on-call incident needs to escalate
to the next rule after the timeout period. to the next rule after the timeout period.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :notifications, queue: :notifications,
max_attempts: 3, max_attempts: 3,
priority: 1 priority: 1

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.ExpiredBanCleanupWorker do
Permanent bans (nil `banned_until`) are not affected. Permanent bans (nil `banned_until`) are not affected.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Security.BruteForce alias Towerops.Security.BruteForce

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.FirmwareVersionFetcherWorker do
Runs daily to check for new firmware releases and updates the firmware_releases table. 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 import SweetXml

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.GaiiaInsightWorker do
Runs nightly to detect: Runs nightly to detect:
- `reconciliation_finding`: Untracked devices, ghost devices, data mismatches - `reconciliation_finding`: Untracked devices, ghost devices, data mismatches
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
use Gettext, backend: ToweropsWeb.Gettext use Gettext, backend: ToweropsWeb.Gettext
import Ecto.Query import Ecto.Query

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.GaiiaSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Gaiia.Sync.sync_organization/1`. 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.Gaiia.Sync
alias Towerops.Integrations alias Towerops.Integrations

View file

@ -4,7 +4,7 @@ defmodule Towerops.Workers.GaiiaWebhookWorker do
the webhook sender immediately. 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 alias Towerops.Gaiia.Webhooks

View file

@ -16,7 +16,7 @@ defmodule Towerops.Workers.InsightExpiryWorker do
max_age_days: 14 max_age_days: 14
""" """
use Oban.Worker, queue: :maintenance, max_attempts: 3 use Oban.Pro.Worker, queue: :maintenance, max_attempts: 3
import Ecto.Query import Ecto.Query

View file

@ -8,7 +8,7 @@ defmodule Towerops.Workers.InsightLlmEnrichmentWorker do
in the UI, just without a plain-language summary. 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
alias Towerops.LLM.InsightPrompt alias Towerops.LLM.InsightPrompt

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.JobHealthCheckWorker do
This handles edge cases where jobs might get cancelled unexpectedly or database This handles edge cases where jobs might get cancelled unexpectedly or database
inconsistencies occur during deployments or pod failures. inconsistencies occur during deployments or pod failures.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.LidarCatalogSyncWorker do
Runs monthly via cron. Discovers Texas LIDAR projects on USGS 3DEP and Runs monthly via cron. Discovers Texas LIDAR projects on USGS 3DEP and
upserts tile metadata into `lidar_tiles`. Does not download raster data. upserts tile metadata into `lidar_tiles`. Does not download raster data.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :lidar, queue: :lidar,
unique: [period: 86_400, states: [:available, :scheduled, :executing, :suspended, :retryable]] unique: [period: 86_400, states: [:available, :scheduled, :executing, :suspended, :retryable]]

View file

@ -8,7 +8,7 @@ defmodule Towerops.Workers.LoginHistoryCleanupWorker do
This worker runs daily at 2 AM via Oban cron. This worker runs daily at 2 AM via Oban cron.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -12,7 +12,7 @@ defmodule Towerops.Workers.MikrotikBackupWorker do
- Are assigned to an agent - 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
alias Towerops.Devices.BackupRequests alias Towerops.Devices.BackupRequests

View file

@ -16,7 +16,7 @@ defmodule Towerops.Workers.MikrotikWebhookWorker do
later. later.
""" """
use Oban.Worker, queue: :default, max_attempts: 5 use Oban.Pro.Worker, queue: :default, max_attempts: 5
alias Towerops.Mikrotik alias Towerops.Mikrotik
alias Towerops.Mikrotik.GaiiaResolver alias Towerops.Mikrotik.GaiiaResolver

View file

@ -22,7 +22,7 @@ defmodule Towerops.Workers.MsBuildingsImportWorker do
we hash the geometry's bounding box so re-running with the same we hash the geometry's bounding box so re-running with the same
data is a no-op. 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.Coverages.Building
alias Towerops.Repo alias Towerops.Repo

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.NetBoxSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `NetBox.Sync.sync_organization/1`. actual sync via `NetBox.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.NetBox.Sync alias Towerops.NetBox.Sync

View file

@ -4,7 +4,7 @@ defmodule Towerops.Workers.PagerdutyWebhookWorker do
the webhook sender immediately. the webhook sender immediately.
""" """
use Oban.Worker, queue: :default, max_attempts: 3 use Oban.Pro.Worker, queue: :default, max_attempts: 3
alias Towerops.Alerts alias Towerops.Alerts

View file

@ -3,7 +3,7 @@ defmodule Towerops.Workers.PreseemBaselineWorker do
Nightly Oban cron worker that computes device baselines and fleet profiles Nightly Oban cron worker that computes device baselines and fleet profiles
for all organizations with enabled Preseem integrations. for all organizations with enabled Preseem integrations.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Preseem.Baseline alias Towerops.Preseem.Baseline

View file

@ -10,7 +10,7 @@ defmodule Towerops.Workers.PreseemSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Preseem.Sync.sync_organization/1`. actual sync via `Preseem.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Preseem.Sync alias Towerops.Preseem.Sync

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.RecommendationsRunWorker do
`evaluate(organization_id) :: [insight_attrs]`. `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 import Ecto.Query

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.ReportWorker do
The cron dispatcher (no args) runs hourly and checks which reports are due. The cron dispatcher (no args) runs hourly and checks which reports are due.
Individual jobs receive `%{"report_id" => id}` and generate + email the report. 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
alias Towerops.Reports.Notifier alias Towerops.Reports.Notifier

View file

@ -5,7 +5,7 @@ defmodule Towerops.Workers.SessionCleanupWorker do
Deletes browser sessions that have passed their expiration timestamp. Deletes browser sessions that have passed their expiration timestamp.
This worker runs daily at 3 AM via Oban cron. This worker runs daily at 3 AM via Oban cron.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Accounts alias Towerops.Accounts

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.SonarSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Sonar.Sync.sync_organization/1`. actual sync via `Sonar.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Sonar.Sync alias Towerops.Sonar.Sync

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.SplynxSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Splynx.Sync.sync_organization/1`. actual sync via `Splynx.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Splynx.Sync alias Towerops.Splynx.Sync

View file

@ -12,7 +12,7 @@ defmodule Towerops.Workers.StaleAgentWorker do
- They have checked in at least once (last_seen_at is not nil) - They have checked in at least once (last_seen_at is not nil)
- They haven't checked in for more than 10 minutes - They haven't checked in for more than 10 minutes
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.StaleViolationCleanupWorker do
Permanent bans are retained indefinitely for audit purposes. Permanent bans are retained indefinitely for audit purposes.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Security.BruteForce alias Towerops.Security.BruteForce

View file

@ -4,7 +4,7 @@ defmodule Towerops.Workers.StripeWebhookWorker do
the webhook sender immediately. 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 alias Towerops.Billing.WebhookProcessor

View file

@ -6,7 +6,7 @@ defmodule Towerops.Workers.SystemInsightWorker do
- `agent_offline`: Agents not seen in over 10 minutes - `agent_offline`: Agents not seen in over 10 minutes
- Auto-resolves agent_offline insights when agents come back online - Auto-resolves agent_offline insights when agents come back online
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
import Ecto.Query import Ecto.Query

View file

@ -10,7 +10,7 @@ defmodule Towerops.Workers.UispSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Uisp.Sync.sync_organization/1`. actual sync via `Uisp.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Uisp.Sync alias Towerops.Uisp.Sync

View file

@ -11,7 +11,7 @@ defmodule Towerops.Workers.VispSyncWorker do
Individual jobs receive `%{"integration_id" => id}` and perform the Individual jobs receive `%{"integration_id" => id}` and perform the
actual sync via `Visp.Sync.sync_organization/1`. actual sync via `Visp.Sync.sync_organization/1`.
""" """
use Oban.Worker, queue: :maintenance use Oban.Pro.Worker, queue: :maintenance
alias Towerops.Integrations alias Towerops.Integrations
alias Towerops.Visp.Sync alias Towerops.Visp.Sync

View file

@ -7,7 +7,7 @@ defmodule Towerops.Workers.WeatherSyncWorker do
Also cleans up observations older than 30 days on each run. Also cleans up observations older than 30 days on each run.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :weather, queue: :weather,
unique: [period: 600, states: [:available, :scheduled, :executing, :suspended, :retryable]] unique: [period: 600, states: [:available, :scheduled, :executing, :suspended, :retryable]]

View file

@ -2,7 +2,7 @@ defmodule Towerops.Workers.WelcomeEmailWorker do
@moduledoc """ @moduledoc """
Sends a welcome email to new users a few minutes after registration. Sends a welcome email to new users a few minutes after registration.
""" """
use Oban.Worker, use Oban.Pro.Worker,
queue: :notifications, queue: :notifications,
max_attempts: 3 max_attempts: 3

View file

@ -10,7 +10,7 @@ defmodule Towerops.Workers.WirelessInsightWorker do
Auto-resolves insights when conditions improve (with hysteresis to prevent flapping). 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 import Ecto.Query