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:
parent
e13519bc3e
commit
9e975aa64b
3 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue