async fn wait_till_volume_status(cluster: &Cluster, volume: &Uuid, status: models::VolumeStatus) {
    let timeout = Duration::from_secs(RECONCILE_TIMEOUT_SECS);
    let start = std::time::Instant::now();
    loop {
        let volume = cluster.rest_v00().volumes_api().get_volume(volume).await;
        if volume.as_ref().unwrap().state.status == status {
            return;
        }

        if std::time::Instant::now() > (start + timeout) {
            panic!(
                "Timeout waiting for the volume to reach the specified status ('{:?}'), current: '{:?}'",
                status, volume
            );
        }
        tokio::time::sleep(Duration::from_millis(500)).await;
    }
}
/// Wait for a volume to reach the provided status
Wait for a volume to reach the provided status
Wait for a volume to reach the provided status
async fn wait_till_volume_status(cluster: &Cluster, volume: &Uuid, status: models::VolumeStatus) {
    let timeout = Duration::from_secs(RECONCILE_TIMEOUT_SECS);
    let start = std::time::Instant::now();
    loop {
        let volume = cluster.rest_v00().volumes_api().get_volume(volume).await;
        if volume.as_ref().unwrap().state.status == status {
            return;
        }
        if std::time::Instant::now() > (start + timeout) {
            panic!(
                "Timeout waiting for the volume to reach the specified status ('{:?}'), current: '{:?}'",
                status, volume
            );
        }
        tokio::time::sleep(Duration::from_millis(500)).await;
    }
}
async fn wait_till_volume_status ( cluster : & Cluster , volume : & Uuid , status : models :: VolumeStatus ) { let timeout = Duration :: from_secs ( RECONCILE_TIMEOUT_SECS ) ; let start = std :: time :: Instant :: now ( ) ; loop { let volume = cluster . rest_v00 ( ) . volumes_api ( ) . get_volume ( volume ) . await ; if volume . as_ref ( ) . unwrap ( ) . state . status == status { return ; } if std :: time :: Instant :: now ( ) > ( start + timeout ) { panic ! ( " " status volume ) ; } tokio :: time :: sleep ( Duration :: from_millis ( 500 ) ) . await ; } }
Wait for a volume to reach the provided status
Wait for a volume to reach the provided status
cluster
&Cluster
volume
&Uuid
status
models::VolumeStatus
cluster
&Cluster
volume
&Uuid
status
models::VolumeStatus