diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-14 21:50:42 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-14 21:50:42 +0200 |
commit | ec5c91d37b46cb3cec4878176469c66d2304dadd (patch) | |
tree | 16b4dd13605d1a3349a4240f3b25b134af572c84 /planetwars-server/src/lib.rs | |
parent | 00459f9e3d818f0fb84160862f02898d64f98110 (diff) | |
download | planetwars.dev-ec5c91d37b46cb3cec4878176469c66d2304dadd.tar.xz planetwars.dev-ec5c91d37b46cb3cec4878176469c66d2304dadd.zip |
change runnerconfig to globalconfig
Diffstat (limited to 'planetwars-server/src/lib.rs')
-rw-r--r-- | planetwars-server/src/lib.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs index eb69c82..d9f5e8e 100644 --- a/planetwars-server/src/lib.rs +++ b/planetwars-server/src/lib.rs @@ -16,8 +16,8 @@ use bb8::{Pool, PooledConnection}; use bb8_diesel::{self, DieselConnectionManager}; use config::ConfigError; use diesel::{Connection, PgConnection}; +use modules::ranking::run_ranker; use modules::registry::registry_service; -use modules::{matches::MatchRunnerConfig, ranking::run_ranker}; use serde::Deserialize; use axum::{ @@ -36,6 +36,11 @@ const SIMPLEBOT_PATH: &str = "../simplebot/simplebot.py"; type ConnectionPool = bb8::Pool<DieselConnectionManager<PgConnection>>; +pub struct GlobalConfig { + pub python_runner_image: String, + pub container_registry_url: String, +} + pub async fn seed_simplebot(pool: &ConnectionPool) { let conn = pool.get().await.expect("could not get database connection"); // This transaction is expected to fail when simplebot already exists. @@ -121,7 +126,7 @@ pub async fn run_app() { let configuration = get_config().unwrap(); let db_pool = prepare_db(&configuration.database_url).await; - let runner_config = Arc::new(MatchRunnerConfig { + let runner_config = Arc::new(GlobalConfig { python_runner_image: "python:3.10-slim-buster".to_string(), container_registry_url: "localhost:9001".to_string(), }); |