fix(workers): unique dedup on polling workers so queued dups don't stack

This commit is contained in:
Graham McIntire 2026-04-21 14:12:43 -05:00
parent 1591ac740d
commit 0d4b24d6d4
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,9 @@
defmodule Microwaveprop.Workers.IemreFetchWorker do
@moduledoc false
use Oban.Worker, queue: :iemre, max_attempts: 20
use Oban.Worker,
queue: :iemre,
max_attempts: 20,
unique: [period: 300, fields: [:args], states: [:scheduled, :available]]
alias Microwaveprop.Weather
alias Microwaveprop.Weather.IemClient

View file

@ -3,7 +3,10 @@ defmodule Microwaveprop.Workers.RtmaFetchWorker do
Fetches RTMA surface observations for real-time propagation scoring.
15-minute resolution provides finer temporal detail than HRRR's hourly cycle.
"""
use Oban.Worker, queue: :rtma, max_attempts: 10
use Oban.Worker,
queue: :rtma,
max_attempts: 10,
unique: [period: 300, fields: [:args], states: [:scheduled, :available]]
alias Microwaveprop.Repo
alias Microwaveprop.Weather.RtmaClient