async fn start_signal_handler(
    signal: Arc<AtomicBool>,
    client: kube::Client,
    node_name: String,
) -> anyhow::Result<()> {
    let duration = std::time::Duration::from_millis(100);
    loop {
        if signal.load(Ordering::Relaxed) {
            info!("Signal caught.");
            node::drain(&client, &node_name).await?;
            break Ok(());
        }
        tokio::time::delay_for(duration).await;
    }
}
/// Checks for shutdown signal and cleans up resources gracefully.
Checks for shutdown signal and cleans up resources gracefully.
Checks for shutdown signal and cleans up resources gracefully .
async fn start_signal_handler(
    signal: Arc<AtomicBool>,
    client: kube::Client,
    node_name: String,
) -> anyhow::Result<()> {
    let duration = std::time::Duration::from_millis(100);
    loop {
        if signal.load(Ordering::Relaxed) {
            info!("Signal caught.");
            node::drain(&client, &node_name).await?;
            break Ok(());
        }
        tokio::time::delay_for(duration).await;
    }
}
async fn start_signal_handler ( signal : Arc < AtomicBool > , client : kube :: Client , node_name : String , ) -> anyhow :: Result < ( ) > { let duration = std :: time :: Duration :: from_millis ( 100 ) ; loop { if signal . load ( Ordering :: Relaxed ) { info ! ( " " ) ; node :: drain ( & client , & node_name ) . await ? ; break Ok ( ( ) ) ; } tokio :: time :: delay_for ( duration ) . await ; } }
Checks for shutdown signal and cleans up resources gracefully.
Checks for shutdown signal and cleans up resources gracefully .
signal
Arc<AtomicBool>
client
kube::Client
node_name
String
signal
Arc<AtomicBool>
client
kube::Client
node_name
String