Use 2-hour lag for HRRR grid fetch to ensure data availability
This commit is contained in:
parent
86e01748ef
commit
f6b1f751d4
1 changed files with 3 additions and 1 deletions
|
|
@ -17,7 +17,9 @@ defmodule Microwaveprop.Workers.PropagationGridWorker do
|
||||||
|
|
||||||
@impl Oban.Worker
|
@impl Oban.Worker
|
||||||
def perform(%Oban.Job{}) do
|
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()
|
points = Grid.conus_points()
|
||||||
|
|
||||||
Logger.info("PropagationGrid: fetching HRRR for #{valid_time}, #{length(points)} points")
|
Logger.info("PropagationGrid: fetching HRRR for #{valid_time}, #{length(points)} points")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue