From 5b10d5e98e806ce867d27c4cc7b7f5651656744f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Mon, 3 Jan 2022 23:33:00 +0100 Subject: add match_state to matches --- planetwars-server/src/routes/matches.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'planetwars-server/src/routes') diff --git a/planetwars-server/src/routes/matches.rs b/planetwars-server/src/routes/matches.rs index 4dfd44e..fed0f7b 100644 --- a/planetwars-server/src/routes/matches.rs +++ b/planetwars-server/src/routes/matches.rs @@ -1,4 +1,4 @@ -use std::{io::Read, path::PathBuf}; +use std::path::PathBuf; use axum::{ extract::{Extension, Path}, @@ -10,7 +10,11 @@ use rand::{distributions::Alphanumeric, Rng}; use serde::{Deserialize, Serialize}; use crate::{ - db::{bots, matches, users::User}, + db::{ + bots, + matches::{self, MatchState}, + users::User, + }, ConnectionPool, DatabaseConnection, BOTS_DIR, MAPS_DIR, MATCHES_DIR, }; @@ -81,6 +85,7 @@ async fn run_match_task( pool: ConnectionPool, ) { let match_data = matches::NewMatch { + state: MatchState::Finished, log_path: &log_file_name, }; -- cgit v1.2.3