tsk-244: Remove code causing migrations to be ran twice (#246)
* tsk-244: Remove code causing migrations to be ran twice * tsk-244: Cleanup * tsk-244: Version bump
This commit was merged in pull request #246.
This commit is contained in:
Generated
+1
-1
@@ -964,7 +964,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "icarus"
|
name = "icarus"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"axum-extra",
|
"axum-extra",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus"
|
name = "icarus"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.90"
|
rust-version = "1.90"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -236,7 +236,7 @@ pub async fn app() -> axum::Router {
|
|||||||
let pool = crate::db::create_pool()
|
let pool = crate::db::create_pool()
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create pool");
|
.expect("Failed to create pool");
|
||||||
// TODO: Look into handling this. Seems redundant to run migrations multiple times
|
|
||||||
crate::db::migrations(&pool).await;
|
crate::db::migrations(&pool).await;
|
||||||
|
|
||||||
let cors = cors::configure_cors().await;
|
let cors = cors::configure_cors().await;
|
||||||
|
|||||||
+8
-8
@@ -9,17 +9,17 @@ async fn main() {
|
|||||||
// initialize tracing
|
// initialize tracing
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
let pool = db::create_pool().await.expect("Failed to create pool");
|
match tokio::net::TcpListener::bind(config::host::get_full()).await {
|
||||||
db::migrations(&pool).await;
|
Ok(listener) => {
|
||||||
|
// build our application with routes
|
||||||
// build our application with a route
|
|
||||||
let app = config::init::app().await;
|
let app = config::init::app().await;
|
||||||
|
|
||||||
let listener = tokio::net::TcpListener::bind(config::host::get_full())
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
axum::serve(listener, app).await.unwrap();
|
axum::serve(listener, app).await.unwrap();
|
||||||
}
|
}
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error: {err:?}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user