Skip to content

Commit fca7c01

Browse files
committed
update nssp based on epidata or socrata timestamp
1 parent 046deea commit fca7c01

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ MIN_TIMESTAMP <- as.POSIXct("2000-01-01 00:00:00S", tz = "UTC")
635635
#' @param missing_value The value to return if the signal is not found.
636636
#'
637637
#' @return The last time the signal was updated in POSIXct format.
638-
get_covidcast_signal_last_update <- function(source, signal, geo_type, missing_value = MAX_TIMESTAMP) {
638+
get_covidcast_signal_last_update <- function(source, signal, geo_type, missing_value = lubridate::now(tz = "UTC")) {
639639
tryCatch(
640640
{
641641
pub_covidcast_meta() %>%

scripts/covid_hosp_prod.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ parameters_and_date_targets <- rlang::list2(
180180
),
181181
tar_change(
182182
nssp_archive_data,
183-
change = get_covidcast_signal_last_update("nssp", "pct_ed_visits_covid", "state"),
183+
change = max(
184+
get_covidcast_signal_last_update("nssp", "pct_ed_visits_covid", "state"),
185+
get_socrata_updated_at("https://data.cdc.gov/api/views/mpgq-jmmr", lubridate::now(tz = "UTC"))
186+
),
184187
command = {
185188
up_to_date_nssp_state_archive("covid")
186189
}

0 commit comments

Comments
 (0)