From 608fd32e5e529c0538159a78559771a6abf80a43 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 20 Apr 2026 13:52:47 -0500 Subject: [PATCH] fix(prune): widen profile/score file cutoff from 2h to 3h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HRRR publishes ~2h after the cycle hour, so the hourly seeder uses run_time = now - 2h. That puts the f00 analysis file's valid_time right at the 2h prune cutoff — the file was being deleted within minutes of the Rust analysis step writing it, leaving /weather and /map point-detail with no data. A 3h cutoff keeps the current analysis alive until the next hourly run supersedes it; forecast files (valid_time >> cutoff) are unaffected. --- lib/microwaveprop/propagation.ex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/microwaveprop/propagation.ex b/lib/microwaveprop/propagation.ex index 3e910f7d..08c7e827 100644 --- a/lib/microwaveprop/propagation.ex +++ b/lib/microwaveprop/propagation.ex @@ -198,12 +198,18 @@ defmodule Microwaveprop.Propagation do end @doc """ - Remove score files with valid_times older than 2 hours. Called on + Remove score files with valid_times older than 3 hours. Called on a cron by `Microwaveprop.Workers.PropagationPruneWorker`. + + The cutoff sits one hour beyond HRRR's ~2h publish lag: the hourly + seeder picks `run_time = now - 2h`, so the f00 analysis file is + written at valid_time = now - 2h. A 2h cutoff deletes it within + minutes; a 3h cutoff keeps it alive until the next hourly run + supersedes it. """ @spec prune_old_scores() :: :ok def prune_old_scores do - cutoff = DateTime.add(DateTime.utc_now(), -2, :hour) + cutoff = DateTime.add(DateTime.utc_now(), -3, :hour) file_deleted = ScoresFile.prune_older_than(cutoff) profiles_deleted = ProfilesFile.prune_older_than(cutoff)