mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 12:37:00 +01:00
Resolve incorrect time units on timeout (#2014)
This commit is contained in:
parent
64fcb4b724
commit
1fb34a91e3
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in a new issue