Aliases: add module aliases for 9 nested module references Apply: replace apply/3 with direct module attribute calls Line length: break 1 long spec line Refactoring: extract helpers to reduce complexity and nesting in show.ex, radio.ex, weather workers, terrain, duct detection, backfill dashboard, contact map, and mix tasks
29 lines
702 B
Elixir
29 lines
702 B
Elixir
defmodule Mix.Tasks.PropagationGrid do
|
|
@shortdoc "Compute propagation scores for the CONUS grid"
|
|
|
|
@moduledoc "Manually trigger propagation grid computation."
|
|
use Mix.Task
|
|
|
|
alias Microwaveprop.Workers.PropagationGridWorker
|
|
|
|
@impl Mix.Task
|
|
def run(_args) do
|
|
# Pause all Oban queues so backfill jobs don't run alongside the grid fetch
|
|
Application.put_env(
|
|
:microwaveprop,
|
|
Oban,
|
|
Keyword.put(
|
|
Application.get_env(:microwaveprop, Oban, []),
|
|
:queues,
|
|
false
|
|
)
|
|
)
|
|
|
|
Mix.Task.run("app.start")
|
|
|
|
IO.puts("Starting propagation grid computation...")
|
|
|
|
PropagationGridWorker.perform(%Oban.Job{args: %{}})
|
|
IO.puts("Done!")
|
|
end
|
|
end
|