/// Write local state to disk in regular intervals
Write local state to disk in regular intervals
Write local state to disk in regular intervals
fn schedule_persistence(&self) {
        let clone = self.clone();
        thread::spawn(move || {
            loop {
                thread::sleep(time::Duration::from_secs(60 * 60)); // Hourly
                let clone = clone.clone();
                thread::spawn(move || match clone.persist_store() {
                    Ok(_) => {}
                    Err(e) => warn!("Saving store to disk failed: {}", e),
                });
            }
        });
    }
fn schedule_persistence ( & self ) { let clone = self . clone ( ) ; thread :: spawn ( move | | { loop { thread :: sleep ( time :: Duration :: from_secs ( 60 * 60 ) ) ; // Hourly let clone = clone . clone ( ) ; thread :: spawn ( move | | match clone . persist_store ( ) { Ok ( _ ) => { } Err ( e ) => warn ! ( " " e ) , } ) ; } } ) ; }
Write local state to disk in regular intervals
Write local state to disk in regular intervals
&self