Skip to content

Commit

Permalink
rename imports to static_data and delete old trip import code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonerrr committed Jul 11, 2024
1 parent 4030bff commit d378a4c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 361 deletions.
2 changes: 1 addition & 1 deletion backend/src/bus/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{env::var, sync::OnceLock};

pub mod imports;
pub mod positions;
pub mod static_data;
pub mod trips;

// https://stackoverflow.com/a/77249700
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
mod alerts;
mod bus;
// mod geo;
mod imports;
mod routes;
mod static_data;
mod trips;

pub mod feed {
Expand Down Expand Up @@ -72,9 +72,9 @@ async fn main() {
// update_transfers(&pool).await;

tracing::info!("Updating bus stops and routes");
bus::imports::stops_and_routes(&pool).await;
bus::static_data::stops_and_routes(&pool).await;
tracing::info!("Updating train stops and routes");
imports::stops_and_routes(&pool).await;
static_data::stops_and_routes(&pool).await;

sqlx::query!("INSERT INTO last_update (update_at) VALUES (now())")
.execute(&pool)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/bus/routes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{bus::imports::Route, routes::errors::ServerError};
use crate::{bus::static_data::Route, routes::errors::ServerError};
use axum::{extract::State, response::IntoResponse, Json};
use http::HeaderMap;
use sqlx::PgPool;
Expand Down
3 changes: 1 addition & 2 deletions backend/src/imports.rs → backend/src/static_data.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::io::Cursor;

use indicatif::{ProgressBar, ProgressStyle};
use rayon::prelude::*;
use serde::{Deserialize, Deserializer};
use sqlx::{PgPool, QueryBuilder};
use std::io::Cursor;

// pub async fn should_update(pool: &PgPool) -> bool {
// let stop_count = sqlx::query!("SELECT COUNT(*) FROM stops as count")
Expand Down
Loading

0 comments on commit d378a4c

Please sign in to comment.