From ec5c91d37b46cb3cec4878176469c66d2304dadd Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Thu, 14 Jul 2022 21:50:42 +0200 Subject: change runnerconfig to globalconfig --- planetwars-server/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'planetwars-server/src/lib.rs') 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>; +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(), }); -- cgit v1.2.3