Add unique constraint to all enrichment workers to prevent duplicates

WeatherFetchWorker, HrrrFetchWorker, and TerrainProfileWorker now have
unique: [period: 3600] — Oban deduplicates identical jobs within 1 hour.
Repeated page loads won't queue redundant fetches.
This commit is contained in:
Graham McIntire 2026-04-02 11:10:22 -05:00
parent e13519bc3e
commit 9e975aa64b
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
3 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
defmodule Microwaveprop.Workers.HrrrFetchWorker do
@moduledoc false
use Oban.Worker, queue: :hrrr, max_attempts: 20
use Oban.Worker, queue: :hrrr, max_attempts: 20, unique: [period: 3600]
alias Microwaveprop.Weather
alias Microwaveprop.Weather.HrrrClient

View file

@ -1,6 +1,6 @@
defmodule Microwaveprop.Workers.TerrainProfileWorker do
@moduledoc false
use Oban.Worker, queue: :terrain, max_attempts: 20
use Oban.Worker, queue: :terrain, max_attempts: 20, unique: [period: 3600]
alias Microwaveprop.Radio
alias Microwaveprop.Terrain

View file

@ -1,6 +1,6 @@
defmodule Microwaveprop.Workers.WeatherFetchWorker do
@moduledoc false
use Oban.Worker, queue: :weather, max_attempts: 20
use Oban.Worker, queue: :weather, max_attempts: 20, unique: [period: 3600]
alias Microwaveprop.Repo
alias Microwaveprop.Weather