pub fn execute(&mut self) -> Result<(), Error> {
        info!("The key manager has been created and is starting execution.");
        loop {
            info!("Checking the status of the keys.");
            match self.execute_once() {
                Ok(_) => {} // Expected case
                Err(Error::LivenessError(last_value, current_value)) => {
                    // Log the liveness error, but don't throw the error up the call stack.
                    error!(
                        "Encountered error, but still continuing to execute: {}",
                        Error::LivenessError(last_value, current_value).to_string()
                    );
                }
                Err(e) => return Err(e), // Unexpected error that we can't handle -- throw!
            };

            info!("Going to sleep for {} seconds.", self.sleep_period_secs);
            COUNTERS.sleeps.inc();
            self.time_service.sleep(self.sleep_period_secs);
        }
    }
/// Begins execution of the key manager by running an infinite loop where the key manager will
/// periodically wake up, verify the state of the validator keys (e.g., the consensus key), and
/// initiate a key rotation when required. If something goes wrong that we can't handle, an
/// error will be returned by this method, upon which the key manager will flag the error and
/// stop execution.
Begins execution of the key manager by running an infinite loop where the key manager will
periodically wake up, verify the state of the validator keys , and
initiate a key rotation when required. If something goes wrong that we can't handle, an
error will be returned by this method, upon which the key manager will flag the error and
stop execution.
Begins execution of the key manager by running an infinite loop where the key manager will periodically wake up verify the state of the validator keys and initiate a key rotation when required . If something goes wrong that we can ' t handle an error will be returned by this method upon which the key manager will flag the error and stop execution .
pub fn execute(&mut self) -> Result<(), Error> {
        info!("The key manager has been created and is starting execution.");
        loop {
            info!("Checking the status of the keys.");
            match self.execute_once() {
                Ok(_) => {} // Expected case
                Err(Error::LivenessError(last_value, current_value)) => {
                    // Log the liveness error, but don't throw the error up the call stack.
                    error!(
                        "Encountered error, but still continuing to execute: {}",
                        Error::LivenessError(last_value, current_value).to_string()
                    );
                }
                Err(e) => return Err(e), // Unexpected error that we can't handle -- throw!
            };
            info!("Going to sleep for {} seconds.", self.sleep_period_secs);
            COUNTERS.sleeps.inc();
            self.time_service.sleep(self.sleep_period_secs);
        }
    }
pub fn execute ( & mut self ) -> Result < ( ) , Error > { info ! ( " " ) ; loop { info ! ( " " ) ; match self . execute_once ( ) { Ok ( _ ) => { } // Expected case Err ( Error :: LivenessError ( last_value , current_value ) ) => { // Log the liveness error, but don't throw the error up the call stack. error ! ( " " Error LivenessError ( last_value current_value ) to_string ( ) ) ; } Err ( e ) => return Err ( e ) , // Unexpected error that we can't handle -- throw! } ; info ! ( " " self sleep_period_secs ) ; COUNTERS . sleeps . inc ( ) ; self . time_service . sleep ( self . sleep_period_secs ) ; } }
Begins execution of the key manager by running an infinite loop where the key manager will
periodically wake up, verify the state of the validator keys (e.g., the consensus key), and
initiate a key rotation when required.
Begins execution of the key manager by running an infinite loop where the key manager will periodically wake up verify the state of the validator keys ( e . g . the consensus key ) and initiate a key rotation when required .
&mut self
&mut self