Skip to content

Commit

Permalink
added final stretch
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderPico committed Sep 8, 2024
1 parent 58bf5a6 commit 0fc180d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions scripts/LOCAL_fetch_figures_v2.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ prepare_date_range <- function(config) {
last_run_date <- ymd(config$last_run)
current_date <- Sys.Date()

if (last_run_date > current_date) {
log_message("Neither date_range nor last_run indicate a valid date range.")
return(NULL)
if (last_run_date %m+% months(2) > current_date) {
log_message("Final stretch, then deactivating cycle.")
start_date <- format(last_run_date, "%Y/%m/%d")
end_date <- format("3000/01/01")
return(list(start_date, end_date))
} else {
start_date <- format(last_run_date, "%Y/%m/%d")
end_date <- format(last_run_date %m+% months(1), "%Y/%m/%d")
Expand Down
8 changes: 5 additions & 3 deletions scripts/fetch_figures_v2.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ prepare_date_range <- function(config) {
last_run_date <- ymd(config$last_run)
current_date <- Sys.Date()

if (last_run_date > current_date) {
log_message("Neither date_range nor last_run indicate a valid date range.")
return(NULL)
if (last_run_date %m+% months(2) > current_date) {
log_message("Final stretch, then deactivating cycle.")
start_date <- format(last_run_date, "%Y/%m/%d")
end_date <- format("3000/01/01")
return(list(start_date, end_date))
} else {
start_date <- format(last_run_date, "%Y/%m/%d")
end_date <- format(last_run_date %m+% months(1), "%Y/%m/%d")
Expand Down

0 comments on commit 0fc180d

Please sign in to comment.