Fix unique constraint blocking re-enqueues of completed jobs
- Only deduplicate against active jobs (available/scheduled/executing/ retryable), not completed ones. Completed jobs no longer block new inserts for the same args. - Period reduced from 3600s to 300s - Fixes contacts stuck in :queued with no actual Oban jobs
This commit is contained in:
parent
a8920e9480
commit
68fdd1d2b6
4 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
defmodule Microwaveprop.Workers.HrrrFetchWorker do
|
||||
@moduledoc false
|
||||
use Oban.Worker, queue: :hrrr, max_attempts: 20, unique: [period: 3600]
|
||||
use Oban.Worker, queue: :hrrr, max_attempts: 20, unique: [period: 300, states: [:available, :scheduled, :executing, :retryable]]
|
||||
|
||||
alias Microwaveprop.Weather
|
||||
alias Microwaveprop.Weather.HrrrClient
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
defmodule Microwaveprop.Workers.SolarIndexWorker do
|
||||
@moduledoc false
|
||||
use Oban.Worker, queue: :solar, max_attempts: 3, unique: [period: 3600]
|
||||
use Oban.Worker, queue: :solar, max_attempts: 3, unique: [period: 300, states: [:available, :scheduled, :executing, :retryable]]
|
||||
|
||||
alias Microwaveprop.Weather
|
||||
alias Microwaveprop.Weather.SolarClient
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
defmodule Microwaveprop.Workers.TerrainProfileWorker do
|
||||
@moduledoc false
|
||||
use Oban.Worker, queue: :terrain, max_attempts: 20, unique: [period: 3600]
|
||||
use Oban.Worker, queue: :terrain, max_attempts: 20, unique: [period: 300, states: [:available, :scheduled, :executing, :retryable]]
|
||||
|
||||
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, unique: [period: 3600]
|
||||
use Oban.Worker, queue: :weather, max_attempts: 20, unique: [period: 300, states: [:available, :scheduled, :executing, :retryable]]
|
||||
|
||||
alias Microwaveprop.Repo
|
||||
alias Microwaveprop.Weather
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue