/// Fail requests if client is blocked due to hitting the error limit. Block thread/wait if less than 30 seconds remaining until reset.
Fail requests if client is blocked due to hitting the error limit. Block thread/wait if less than 30 seconds remaining until reset.
Fail requests if client is blocked due to hitting the error limit . Block thread / wait if less than 30 seconds remaining until reset .
fn limit_errors(&self) -> Result<()> {
        let locked_until = self.0.read().locked_until;
        if locked_until > Utc::now() {
            let difference = locked_until.signed_duration_since(Utc::now());
            if difference > Duration::seconds(30) {
                bail!(errors::ErrorKind::ESIErrorLimitError("Skipped request as we're blocked by ESI!".to_owned()));
            }
            thread::sleep(difference.to_std()?);
        }
        Ok(())
    }
fn limit_errors ( & self ) -> Result < ( ) > { let locked_until = self . 0 . read ( ) . locked_until ; if locked_until > Utc :: now ( ) { let difference = locked_until . signed_duration_since ( Utc :: now ( ) ) ; if difference > Duration :: seconds ( 30 ) { bail ! ( errors ErrorKind ESIErrorLimitError ( " " to_owned ( ) ) ) ; } thread :: sleep ( difference . to_std ( ) ? ) ; } Ok ( ( ) ) }
Fail requests if client is blocked due to hitting the error limit.
Fail requests if client is blocked due to hitting the error limit .
&self