From d95098daa918f7ef13bb6a1c968cf26a6b16322e Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 2 Apr 2026 15:30:06 -0500 Subject: [PATCH] Remove queue pausing from PropagationGridWorker --- .../workers/propagation_grid_worker.ex | 54 ++++++++----------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/lib/microwaveprop/workers/propagation_grid_worker.ex b/lib/microwaveprop/workers/propagation_grid_worker.ex index b201755a..593401f4 100644 --- a/lib/microwaveprop/workers/propagation_grid_worker.ex +++ b/lib/microwaveprop/workers/propagation_grid_worker.ex @@ -18,9 +18,6 @@ defmodule Microwaveprop.Workers.PropagationGridWorker do require Logger - # Pause these queues while the grid fetch runs so they don't compete for bandwidth. - # Keep :hrrr running so on-demand contact detail fetches aren't blocked. - @pause_queues [:weather, :iemre, :terrain] @max_forecast_hour 18 @impl Oban.Worker @@ -34,41 +31,34 @@ defmodule Microwaveprop.Workers.PropagationGridWorker do Logger.info("PropagationGrid: run_time=#{run_time}, #{length(points)} points, f00-f#{@max_forecast_hour}") - Enum.each(@pause_queues, &Oban.pause_queue(queue: &1)) + for_result = + for fh <- 0..@max_forecast_hour do + valid_time = DateTime.add(run_time, fh * 3600, :second) + result = process_forecast_hour(points, run_time, fh, valid_time) - try do - for_result = - for fh <- 0..@max_forecast_hour do - valid_time = DateTime.add(run_time, fh * 3600, :second) - result = process_forecast_hour(points, run_time, fh, valid_time) - - case result do - :ok -> valid_time - _ -> nil - end + case result do + :ok -> valid_time + _ -> nil end - - valid_times = Enum.reject(for_result, &is_nil/1) - - if valid_times != [] do - Phoenix.PubSub.broadcast( - Microwaveprop.PubSub, - "propagation:updated", - {:propagation_updated, valid_times} - ) end - total_ms = System.monotonic_time(:millisecond) - t_start - Logger.info("PropagationGrid: total time #{format_duration(total_ms)} (#{length(valid_times)} forecast hours)") + valid_times = Enum.reject(for_result, &is_nil/1) - :ok - after - Logger.info("PropagationGrid: resuming backfill queues") - Enum.each(@pause_queues, &Oban.resume_queue(queue: &1)) - - Weather.prune_old_grid_profiles() - Propagation.prune_old_scores() + if valid_times != [] do + Phoenix.PubSub.broadcast( + Microwaveprop.PubSub, + "propagation:updated", + {:propagation_updated, valid_times} + ) end + + total_ms = System.monotonic_time(:millisecond) - t_start + Logger.info("PropagationGrid: total time #{format_duration(total_ms)} (#{length(valid_times)} forecast hours)") + + Weather.prune_old_grid_profiles() + Propagation.prune_old_scores() + + :ok end defp process_forecast_hour(points, run_time, forecast_hour, valid_time) do