prop/lib/mix/tasks/reset_enrichment.ex
Graham McIntire 254e64dedc
Rename qsos to contacts throughout codebase, keep DB table name
Rename all modules, functions, variables, routes, and UI text from
qso/qsos to contact/contacts. Database table stays as "qsos" to avoid
migration. Add /qsos -> /contacts redirects for old URLs.
2026-04-01 11:25:04 -05:00

33 lines
917 B
Elixir

defmodule Mix.Tasks.ResetEnrichment do
@shortdoc "Reset weather/HRRR/IEMRE enrichment flags for re-processing"
@moduledoc """
Resets weather, HRRR, and IEMRE enrichment flags on all QSOs so the
next enqueue worker run re-processes them with multi-point path data.
Does NOT reset terrain_queued since terrain profiles are path-based (pos1→pos2)
and don't change with multi-point enrichment.
mix reset_enrichment
"""
use Mix.Task
import Ecto.Query
alias Microwaveprop.Radio.Contact
alias Microwaveprop.Repo
@impl Mix.Task
def run(_args) do
Mix.Task.run("app.start")
{count, _} =
Contact
|> where([q], q.weather_queued == true or q.hrrr_queued == true or q.iemre_queued == true)
|> Repo.update_all(set: [weather_queued: false, hrrr_queued: false, iemre_queued: false])
Mix.shell().info("Reset enrichment flags on #{count} QSOs")
:ok
end
end