diff --git a/zeusd/Cargo.lock b/zeusd/Cargo.lock index 6a82076c..66b461ea 100644 --- a/zeusd/Cargo.lock +++ b/zeusd/Cargo.lock @@ -2023,7 +2023,7 @@ dependencies = [ ] [[package]] -name = "zeusd" +name = "zeus" version = "0.1.0" dependencies = [ "actix-web", diff --git a/zeusd/Cargo.toml b/zeusd/Cargo.toml index 2576b020..f2874c1e 100644 --- a/zeusd/Cargo.toml +++ b/zeusd/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "zeusd" +name = "zeus" version = "0.1.0" authors = ["Jae-Won Chung "] description = "Zeus daemon" diff --git a/zeusd/src/routes/gpu.rs b/zeusd/src/routes/gpu.rs index 0aeb6c36..440a25ec 100644 --- a/zeusd/src/routes/gpu.rs +++ b/zeusd/src/routes/gpu.rs @@ -3,6 +3,7 @@ use actix_web::{web, HttpResponse}; use paste::paste; use serde::{Deserialize, Serialize}; +use std::time::Instant; use crate::devices::gpu::{GpuCommand, GpuManagementTasks}; use crate::error::ZeusdError; @@ -59,16 +60,15 @@ macro_rules! impl_handler_for_gpu_command { request: web::Json<[<$api:camel>]>, device_tasks: web::Data, ) -> Result { - let now = std::time::Instant::now(); - let gpu_id = gpu_id.into_inner(); - let request = request.into_inner(); + let now = Instant::now(); tracing::info!("Received request"); + let gpu_id = gpu_id.into_inner(); + let request = request.into_inner(); + if request.block { - device_tasks - .send_command_blocking(gpu_id, request.into(), now) - .await?; + device_tasks.send_command_blocking(gpu_id, request.into(), now).await?; } else { device_tasks.send_command_nonblocking(gpu_id, request.into(), now)?; }