Set up key-value store in server main
All checks were successful
Push Workflows / rustfmt (push) Successful in 13s
Push Workflows / tailwind-build (push) Successful in 12s
Push Workflows / docs (push) Successful in 38s
Push Workflows / clippy (push) Successful in 41s
Push Workflows / test (push) Successful in 48s
Push Workflows / build (push) Successful in 1m45s
Push Workflows / nix-build (push) Successful in 5m21s
All checks were successful
Push Workflows / rustfmt (push) Successful in 13s
Push Workflows / tailwind-build (push) Successful in 12s
Push Workflows / docs (push) Successful in 38s
Push Workflows / clippy (push) Successful in 41s
Push Workflows / test (push) Successful in 48s
Push Workflows / build (push) Successful in 1m45s
Push Workflows / nix-build (push) Successful in 5m21s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
use crate::App;
|
||||
use crate::server::{config, database};
|
||||
use crate::server::{config, database, key_val_store};
|
||||
use crate::util::error::{Contextualize, Error, Result};
|
||||
|
||||
pub fn main() -> Result<()> {
|
||||
@@ -22,10 +22,16 @@ pub fn main() -> Result<()> {
|
||||
.map_err(|e| Error::message_here(e.to_string()))
|
||||
.err_context("Failed to create tokio runtime for server setup")?;
|
||||
|
||||
let _db_pool = setup_rt.block_on(async {
|
||||
database::setup(config.database.connection_uri())
|
||||
let (_db_pool, _key_val_pool) = setup_rt.block_on(async {
|
||||
let db_pool = database::setup(config.database.connection_uri())
|
||||
.await
|
||||
.err_context("Failed database setup")
|
||||
.err_context("Failed database setup")?;
|
||||
|
||||
let key_val_pool = key_val_store::setup(&config.key_val_store.connection_uri())
|
||||
.await
|
||||
.err_context("Failed key-value store setup")?;
|
||||
|
||||
Ok::<_, Error>((db_pool, key_val_pool))
|
||||
})?;
|
||||
|
||||
tracing::info!("Setup complete, launching web server...");
|
||||
|
||||
Reference in New Issue
Block a user