Resolve incorrect time units on timeout (#2014)

This commit is contained in:
Firstyear 2023-08-21 14:14:32 +10:00 committed by William Brown
parent 64fcb4b724
commit 1fb34a91e3

View file

@ -81,12 +81,12 @@ pub async fn call_daemon(
req: ClientRequest, req: ClientRequest,
timeout: u64, timeout: u64,
) -> Result<ClientResponse, Box<dyn Error>> { ) -> Result<ClientResponse, Box<dyn Error>> {
let sleep = time::sleep(Duration::from_millis(timeout)); let sleep = time::sleep(Duration::from_secs(timeout));
tokio::pin!(sleep); tokio::pin!(sleep);
tokio::select! { tokio::select! {
_ = &mut sleep => { _ = &mut sleep => {
error!("Timed out making request to kanidm_unixd"); error!(?timeout, "Timed out making request to kanidm_unixd");
Err(Box::new(IoError::new(ErrorKind::Other, "timeout"))) Err(Box::new(IoError::new(ErrorKind::Other, "timeout")))
} }
res = call_daemon_inner(path, req) => { res = call_daemon_inner(path, req) => {