aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/lib.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-09 23:27:22 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-09 23:27:22 +0200
commit406c7266019c0c36cfe5069bfe5cf293badd3a30 (patch)
tree1f5d054add282f45d9ff14de7a62160ff7ca31b2 /planetwars-server/src/lib.rs
parent58c1c5f9fb48040ad6b0891d586543c219de74d2 (diff)
downloadplanetwars.dev-406c7266019c0c36cfe5069bfe5cf293badd3a30.tar.xz
planetwars.dev-406c7266019c0c36cfe5069bfe5cf293badd3a30.zip
create password reset utility
Co-authored-by: Wout Schellaert <wout.schellaert@gmail.com>
Diffstat (limited to 'planetwars-server/src/lib.rs')
-rw-r--r--planetwars-server/src/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs
index 804dcd5..4950815 100644
--- a/planetwars-server/src/lib.rs
+++ b/planetwars-server/src/lib.rs
@@ -94,11 +94,9 @@ pub async fn seed_simplebot(config: &GlobalConfig, pool: &ConnectionPool) {
pub type DbPool = Pool<DieselConnectionManager<PgConnection>>;
-pub async fn prepare_db(config: &GlobalConfig) -> DbPool {
+pub async fn create_db_pool(config: &GlobalConfig) -> DbPool {
let manager = DieselConnectionManager::<PgConnection>::new(&config.database_url);
- let pool = bb8::Pool::builder().build(manager).await.unwrap();
- seed_simplebot(config, &pool).await;
- pool
+ bb8::Pool::builder().build(manager).await.unwrap()
}
// create all directories required for further operation
@@ -165,7 +163,8 @@ async fn run_registry(config: Arc<GlobalConfig>, db_pool: DbPool) {
pub async fn run_app() {
let global_config = Arc::new(get_config().unwrap());
- let db_pool = prepare_db(&global_config).await;
+ let db_pool = create_db_pool(&global_config).await;
+ seed_simplebot(&global_config, &db_pool).await;
init_directories(&global_config).unwrap();
if global_config.ranker_enabled {