aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'planetwars-server/src/lib.rs')
-rw-r--r--planetwars-server/src/lib.rs9
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(),
});