Truncate valid_time microseconds for Ecto utc_datetime

This commit is contained in:
Graham McIntire 2026-03-31 08:48:32 -05:00
parent 22cb055269
commit becdf89978
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -21,7 +21,7 @@ defmodule Microwaveprop.Workers.PropagationGridWorker do
def perform(%Oban.Job{}) do
# 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)
valid_time = two_hours_ago |> HrrrClient.nearest_hrrr_hour() |> DateTime.truncate(:second)
points = Grid.conus_points()
Logger.info("PropagationGrid: pausing backfill queues, fetching HRRR for #{valid_time}, #{length(points)} points")