26 lines
818 B
Elixir
26 lines
818 B
Elixir
defmodule Microwaveprop.Workers.RoverMissionBackfillWorker do
|
||
@moduledoc """
|
||
Periodic safety net for the `/rover-planning` matrix. Walks every
|
||
mission and re-enqueues `RoverPathProfileWorker` jobs for any
|
||
`(rover_location × station)` pair whose `Path` is missing or not
|
||
`:complete`. The path-profile worker short-circuits on `:complete`,
|
||
so this is idempotent across runs.
|
||
|
||
Recovers from transient failures (elevation API blips, rolling
|
||
deploys that interrupted the original `create_mission` enqueue)
|
||
without operator action.
|
||
"""
|
||
|
||
use Oban.Pro.Worker,
|
||
queue: :terrain,
|
||
priority: 5,
|
||
max_attempts: 3,
|
||
unique: [period: 300, states: :incomplete]
|
||
|
||
alias Microwaveprop.RoverPlanning
|
||
|
||
@impl Oban.Pro.Worker
|
||
def process(%Oban.Job{}) do
|
||
RoverPlanning.backfill_paths()
|
||
end
|
||
end
|