From f9c6e3730a75f66843d82fb29f410bef7d17038d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 2 Apr 2026 16:46:12 -0500 Subject: [PATCH] Allow retry of unavailable enrichment on page load --- lib/microwaveprop_web/live/contact_live/show.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/microwaveprop_web/live/contact_live/show.ex b/lib/microwaveprop_web/live/contact_live/show.ex index 9a93d0b0..0c3d55fe 100644 --- a/lib/microwaveprop_web/live/contact_live/show.ex +++ b/lib/microwaveprop_web/live/contact_live/show.ex @@ -200,7 +200,7 @@ defmodule MicrowavepropWeb.ContactLive.Show do %{contact | weather_status: :complete} - contact.pos1 && contact.weather_status not in [:queued, :unavailable] -> + contact.pos1 && contact.weather_status != :queued -> jobs = ContactWeatherEnqueueWorker.build_weather_jobs([contact]) if jobs != [] do @@ -208,7 +208,6 @@ defmodule MicrowavepropWeb.ContactLive.Show do Radio.set_enrichment_status!([contact.id], :weather_status, :queued) %{contact | weather_status: :queued} else - Radio.set_enrichment_status!([contact.id], :weather_status, :unavailable) %{contact | weather_status: :unavailable} end @@ -301,7 +300,7 @@ defmodule MicrowavepropWeb.ContactLive.Show do defp maybe_enqueue_terrain(nil, contact) do cond do - contact.pos1 && contact.pos2 && contact.terrain_status not in [:queued, :unavailable] -> + contact.pos1 && contact.pos2 && contact.terrain_status != :queued -> case Oban.insert(TerrainProfileWorker.new(%{"contact_id" => contact.id})) do {:ok, %{conflict?: false}} -> Radio.set_enrichment_status!([contact.id], :terrain_status, :queued) @@ -331,7 +330,7 @@ defmodule MicrowavepropWeb.ContactLive.Show do lat = contact.pos1 && contact.pos1["lat"] lon = contact.pos1 && (contact.pos1["lon"] || contact.pos1["lng"]) - if lat && lon && contact.hrrr_status not in [:queued, :unavailable] do + if lat && lon && contact.hrrr_status != :queued do valid_time = HrrrClient.nearest_hrrr_hour(contact.qso_timestamp) {rlat, rlon} = Weather.round_to_hrrr_grid(lat, lon)