pub async fn refresh_config(
    config: Arc<Mutex<State>>,
    proxy: &EventLoopProxy<Events>,
    update_tx: mpsc::Sender<()>,
) {
    loop {
        let old_config = {
            // Copy the config so we can compare it.
            config.lock().unwrap().clone()
        };

        let new_config = config::read();

        if old_config != new_config {
            config::migrate(&config, new_config);

            // Notify the network thread that we have to request an update.
            update_tx.send(()).ok();

            proxy.send_event(Events::UpdatedChannels).ok();
        }

        std::thread::sleep(READ_CONFIG_FILE_TIME);
    }
}
/// Periodically refresh the global state from the configuration file.

Periodically refresh the global state from the configuration file.
Periodically refresh the global state from the configuration file .
pub async fn refresh_config(
    config: Arc<Mutex<State>>,
    proxy: &EventLoopProxy<Events>,
    update_tx: mpsc::Sender<()>,
) {
    loop {
        let old_config = {
            // Copy the config so we can compare it.
            config.lock().unwrap().clone()
        };
        let new_config = config::read();
        if old_config != new_config {
            config::migrate(&config, new_config);
            // Notify the network thread that we have to request an update.
            update_tx.send(()).ok();
            proxy.send_event(Events::UpdatedChannels).ok();
        }
        std::thread::sleep(READ_CONFIG_FILE_TIME);
    }
}
pub async fn refresh_config ( config : Arc < Mutex < State > > , proxy : & EventLoopProxy < Events > , update_tx : mpsc :: Sender < ( ) > , ) { loop { let old_config = { // Copy the config so we can compare it.
 config . lock ( ) . unwrap ( ) . clone ( ) } ; let new_config = config :: read ( ) ; if old_config != new_config { config :: migrate ( & config , new_config ) ; // Notify the network thread that we have to request an update.
 update_tx . send ( ( ) ) . ok ( ) ; proxy . send_event ( Events :: UpdatedChannels ) . ok ( ) ; } std :: thread :: sleep ( READ_CONFIG_FILE_TIME ) ; } }
Periodically refresh the global state from the configuration file.
Periodically refresh the global state from the configuration file .
config
Arc<Mutex<State>>
proxy
&EventLoopProxy<Events>
update_tx
mpsc::Sender<()>