for(auto& dss : g_dstates.getCopy()) { // this points to the actual shared_ptrs!
if(dss->availability==DownstreamState::Availability::Auto) {
bool newState=upCheck(*dss);
- if (!newState && dss->upStatus) {
+ if (newState) {
+ if (dss->currentCheckFailures != 0) {
+ dss->currentCheckFailures = 0;
+ }
+ }
+ else if (!newState && dss->upStatus) {
dss->currentCheckFailures++;
if (dss->currentCheckFailures < dss->maxCheckFailures) {
newState = true;