Fix failcount logic

This commit is contained in:
asonix 2020-06-08 15:38:47 -05:00
parent b45a061184
commit a23d979b86

View file

@ -130,10 +130,12 @@ async fn main() -> Result<(), anyhow::Error> {
if let Err(_) = timeout(Duration::from_secs(2), ctrl_dns_rx.next()).await {
warn!("Failed to get response for test query");
fail_count += 1;
} else if use_fallback.load(Ordering::Relaxed) {
info!("TLS server back online, disabling fallback");
} else {
if use_fallback.load(Ordering::Relaxed) {
info!("TLS server back online, disabling fallback");
use_fallback.store(false, Ordering::Relaxed);
}
fail_count = 0;
use_fallback.store(false, Ordering::Relaxed);
}
}
});