From bcbe2b78a36aa0b1e04a142c9a49cc315662372a Mon Sep 17 00:00:00 2001 From: Rob Wiederstein Date: Mon, 9 Mar 2026 12:40:41 -0400 Subject: [PATCH] Add weekly cron for owners refresh; fix download timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - options(timeout = 300) added to update_owners.R — 87.5 MB SCPA file exceeds the 60s default - TODO updated: cron job tested end-to-end 2026-03-09 --- TODO.md | 7 +++---- data-raw/update_owners.R | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index ea6d02d..72dee62 100644 --- a/TODO.md +++ b/TODO.md @@ -9,10 +9,9 @@ - [ ] Verify SCPA Public.xlsx column structure is stable across downloads - [ ] Delete app from shinyapps.io (account: rob-wiederstein, appId: 14173710) -- [ ] Add cron job to run `update_owners.R` weekly inside the rstudio container: - `docker exec rstudio Rscript /home/rstudio/projects/r/stAndrews/data-raw/update_owners.R` - Note: app must reload `owners.rds` after refresh — either restart container or - make app reactive to file changes +- [x] Add cron job to run `update_owners.R` weekly inside the rstudio container: + Runs every Sunday at 11pm via crontab; restarts standrews_shiny after; logs to ~/standrews_update.log + Tested end-to-end 2026-03-09 — 388 owners written, options(timeout=300) required for 87.5 MB download ## Features diff --git a/data-raw/update_owners.R b/data-raw/update_owners.R index cff7d0e..cd7fcf6 100644 --- a/data-raw/update_owners.R +++ b/data-raw/update_owners.R @@ -12,6 +12,8 @@ library(dplyr) library(stringr) library(sf) +options(timeout = 300) + subdivisions <- c( "8120", "8113", "8171", "8195", "8221", "8163", "8240", "8159", "8149", "8110", "8254", "8215", "8143"