From b6bceb3ff89ba62f7c4b32ce6ceaf1f4071050a4 Mon Sep 17 00:00:00 2001 From: Joe Bellus Date: Thu, 10 Feb 2022 22:40:04 -0500 Subject: [PATCH] Updated main --- build.rs | 3 --- src/main.rs | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 build.rs diff --git a/build.rs b/build.rs deleted file mode 100644 index 1dab3ed..0000000 --- a/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -use std::process::Command; - -fn main() {} diff --git a/src/main.rs b/src/main.rs index 7deac07..f0f5b84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ use actix_web::{get, web, App, HttpResponse, HttpServer}; use rust_embed::RustEmbed; use sea_orm::{Database, DatabaseConnection}; -use sqlx::SqliteConnection; use tracing::{info, instrument}; use tracing_subscriber::prelude::*; @@ -10,9 +9,10 @@ mod auth; mod entity; mod error; -// Use Jemalloc only for musl-64 bits platforms #[cfg(all(target_env = "musl", target_pointer_width = "64"))] #[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + #[derive(Debug)] pub struct AppState { pub db: DatabaseConnection, @@ -69,7 +69,7 @@ async fn dist(path: web::Path) -> HttpResponse { .body(body) } -use sqlx::Connection; +#[instrument] async fn setup_database() -> error::Result { let pool = sqlx::SqlitePool::connect("sqlite://data.db").await?; sqlx::migrate!("./migrations").run(&pool).await?;