From 620d4c684e2e428c71f00e348fc70fc1e9d1de12 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Thu, 6 Nov 2025 12:47:55 -0500 Subject: [PATCH 1/3] tsk-244: Remove code causing migrations to be ran twice --- src/config/init.rs | 2 +- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/init.rs b/src/config/init.rs index c41029b..3ea950e 100644 --- a/src/config/init.rs +++ b/src/config/init.rs @@ -236,7 +236,7 @@ pub async fn app() -> axum::Router { let pool = crate::db::create_pool() .await .expect("Failed to create pool"); - // TODO: Look into handling this. Seems redundant to run migrations multiple times + crate::db::migrations(&pool).await; let cors = cors::configure_cors().await; diff --git a/src/main.rs b/src/main.rs index af168ff..d433503 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,8 @@ async fn main() { // initialize tracing tracing_subscriber::fmt::init(); - let pool = db::create_pool().await.expect("Failed to create pool"); - db::migrations(&pool).await; + // let pool = db::create_pool().await.expect("Failed to create pool"); + // db::migrations(&pool).await; // build our application with a route let app = config::init::app().await; -- 2.47.3 From 057750deb61f1e716ff81485f8684bad5d1cabfc Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Thu, 6 Nov 2025 12:51:18 -0500 Subject: [PATCH 2/3] tsk-244: Cleanup --- src/main.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index d433503..830d684 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,16 +9,16 @@ async fn main() { // initialize tracing tracing_subscriber::fmt::init(); - // let pool = db::create_pool().await.expect("Failed to create pool"); - // db::migrations(&pool).await; - - // build our application with a route - let app = config::init::app().await; - - let listener = tokio::net::TcpListener::bind(config::host::get_full()) - .await - .unwrap(); - axum::serve(listener, app).await.unwrap(); + match tokio::net::TcpListener::bind(config::host::get_full()).await { + Ok(listener) => { + // build our application with routes + let app = config::init::app().await; + axum::serve(listener, app).await.unwrap(); + } + Err(err) => { + eprintln!("Error: {err:?}") + } + } } #[cfg(test)] -- 2.47.3 From b54e634cf8e15d55954a7fc0b5d9b820087f1902 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Thu, 6 Nov 2025 12:51:40 -0500 Subject: [PATCH 3/3] tsk-244: Version bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7aa646..5395b8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,7 +964,7 @@ dependencies = [ [[package]] name = "icarus" -version = "0.3.26" +version = "0.3.27" dependencies = [ "axum", "axum-extra", diff --git a/Cargo.toml b/Cargo.toml index 967e4a8..2bc9c48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus" -version = "0.3.26" +version = "0.3.27" edition = "2024" rust-version = "1.90" -- 2.47.3