Use 2-hour lag for HRRR grid fetch to ensure data availability

This commit is contained in:
Graham McIntire 2026-03-30 17:32:39 -05:00
parent 86e01748ef
commit f6b1f751d4
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -17,7 +17,9 @@ defmodule Microwaveprop.Workers.PropagationGridWorker do
@impl Oban.Worker
def perform(%Oban.Job{}) do
valid_time = HrrrClient.nearest_hrrr_hour(DateTime.utc_now())
# HRRR takes ~45min to publish after the hour. Use 2 hours ago to ensure availability.
two_hours_ago = DateTime.add(DateTime.utc_now(), -2, :hour)
valid_time = HrrrClient.nearest_hrrr_hour(two_hours_ago)
points = Grid.conus_points()
Logger.info("PropagationGrid: fetching HRRR for #{valid_time}, #{length(points)} points")