prop/lib/microwaveprop/workers/rover_mission_backfill_worker.ex
Graham McIntire ea3033da03
chore: update to elixir 1.20 / otp 29, fix compile warnings
- Update .tool-versions to elixir 1.20.0-otp-29 / erlang 29.0.1
- Update all hex dependencies
- Remove unused aliases in path_compute.ex and rover_planning_live/show.ex
- Fix Oban unique states to include :suspended (use :incomplete group)
2026-06-03 14:34:39 -05:00

26 lines
810 B
Elixir
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.Worker,
queue: :terrain,
priority: 5,
max_attempts: 3,
unique: [period: 300, states: :incomplete]
alias Microwaveprop.RoverPlanning
@impl Oban.Worker
def perform(%Oban.Job{}) do
RoverPlanning.backfill_paths()
end
end