Skip to content

Commit

Permalink
protection from accidently deleting prod
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Jan 6, 2024
1 parent c154a75 commit 2f211ac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ingest_gtfs_schedule/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
.unwrap()
.get::<bool>("softinsert");

let forcewipe = arguments::parse(std::env::args())
.unwrap()
.get::<bool>("forcewipe")
.unwrap_or_else(|| false);

if (startfresh.unwrap_or(false) && isprod.unwrap_or(false) && forcewipe) {
panic!("Cannot wipe the prod server without --forcewipe true");
}

let schemaname = match is_prod {
Some(s) => {
if s {
Expand Down

0 comments on commit 2f211ac

Please sign in to comment.