From 16f47c13a541d582ff1f343837f71baace8667e7 Mon Sep 17 00:00:00 2001 From: tom1484 Date: Sun, 4 Feb 2024 07:24:34 +0800 Subject: [PATCH] fix initRedis after upload --- editor-server/src/routes/api/upload_data.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor-server/src/routes/api/upload_data.rs b/editor-server/src/routes/api/upload_data.rs index 03f35b6f8..700ac64f7 100644 --- a/editor-server/src/routes/api/upload_data.rs +++ b/editor-server/src/routes/api/upload_data.rs @@ -16,7 +16,7 @@ struct ControlData { #[derive(Debug, Deserialize, Serialize)] struct PositionData { start: i32, - pos: Vec<[i32; 3]>, + pos: Vec<[f32; 3]>, } #[derive(Debug, Deserialize, Serialize)] @@ -410,6 +410,9 @@ pub async fn upload_data( } control_progress.finish(); + tx.commit().await.into_result()?; + println!("Upload Finish!"); + init_redis_control(clients.mysql_pool(), clients.redis_client()) .await .expect("Error initializing redis control."); @@ -417,8 +420,6 @@ pub async fn upload_data( .await .expect("Error initializing redis position."); - tx.commit().await.into_result()?; - println!("Upload Finish!"); Ok(( StatusCode::OK, Json(UploadDataResponse(