tsk-244: Remove code causing migrations to be ran twice #246

Merged
kdeng00 merged 3 commits from tsk-244 into main 2025-11-06 12:56:47 -05:00
4 changed files with 13 additions and 13 deletions
Generated
+1 -1
View File
@@ -964,7 +964,7 @@ dependencies = [
[[package]]
name = "icarus"
version = "0.3.26"
version = "0.3.27"
dependencies = [
"axum",
"axum-extra",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "icarus"
version = "0.3.26"
version = "0.3.27"
edition = "2024"
rust-version = "1.90"
+1 -1
View File
@@ -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;
+10 -10
View File
@@ -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)]