Skip to content

Commit

Permalink
remove REINIT_ON_FAIL
Browse files Browse the repository at this point in the history
  • Loading branch information
plazmoid committed Jan 20, 2023
1 parent 61ff55c commit a94cca2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions wavesexchange_repos/src/circuit_breaker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use std::{
use tokio::sync::RwLock;

pub trait FallibleDataSource {
const REINIT_ON_FAIL: bool;
type Error;

fn is_countable_err(err: &Self::Error) -> bool;
Expand Down Expand Up @@ -165,9 +164,7 @@ impl<S: FallibleDataSource> CircuitBreaker<S> {
}
None => state.first_err_ts = Some(Instant::now()),
}
if S::REINIT_ON_FAIL {
state.reinit((self.init_fn)()?);
}
state.reinit((self.init_fn)()?);
}
} else {
let mut state = self.state.write().await;
Expand Down Expand Up @@ -196,8 +193,6 @@ mod tests {
}

impl FallibleDataSource for WildErrorGenerator {
const REINIT_ON_FAIL: bool = true;

type Error = WildError;

fn is_countable_err(err: &Self::Error) -> bool {
Expand Down

0 comments on commit a94cca2

Please sign in to comment.