Skip to content

Commit

Permalink
added the skip_{db,ms}_setup features
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jan 23, 2024
1 parent fdbc6ec commit 0e4894a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions server/main-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ lazy_static = "1.4.0"

[dev-dependencies]
pretty_assertions.workspace = true

[features]
skip_db_setup=[]
skip_ms_setup=[]
6 changes: 3 additions & 3 deletions server/main-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.init();
let uri = connection_string();
let pool = PgPoolOptions::new().connect(&uri).await?;
info!("setting up the database");
#[cfg(not(skip_db_setup))]
setup::database::setup_database(&pool).await?;
//info!("setting up meilisearch");
//setup::meilisearch::setup_meilisearch().await?;
#[cfg(not(skip_ms_setup))]
setup::meilisearch::setup_meilisearch().await?;

debug!("setting up metrics");
let labels = HashMap::from([(
Expand Down
4 changes: 4 additions & 0 deletions server/main-api/src/setup/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@

#[cfg(not(skip_db_setup))]
pub(crate) mod database;

#[cfg(not(skip_ms_setup))]
pub(crate) mod meilisearch;

0 comments on commit 0e4894a

Please sign in to comment.