aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/routes
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-01-03 23:33:00 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-01-03 23:36:19 +0100
commit5b10d5e98e806ce867d27c4cc7b7f5651656744f (patch)
tree1397bc803f1b87e8811be05334a7aeb45032811b /planetwars-server/src/routes
parent1cde40b45916d1f99a4cda7837b516cde761f127 (diff)
downloadplanetwars.dev-5b10d5e98e806ce867d27c4cc7b7f5651656744f.tar.xz
planetwars.dev-5b10d5e98e806ce867d27c4cc7b7f5651656744f.zip
add match_state to matches
Diffstat (limited to 'planetwars-server/src/routes')
-rw-r--r--planetwars-server/src/routes/matches.rs9
1 files changed, 7 insertions, 2 deletions
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,
};