Merge pull request #2427 from SwarmboticsAI/fix-active-backup-selection
Some checks failed
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled

Fix active backup link selection
This commit is contained in:
Joseph Henry 2025-07-03 10:55:38 -07:00 committed by GitHub
commit 226bb1d4ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1750,19 +1750,12 @@ void Bond::processActiveBackupTasks(void* tPtr, int64_t now)
} }
} }
} }
/*
// Sort queue based on performance // Sort queue based on performance
if (! _abFailoverQueue.empty()) { std::sort(_abFailoverQueue.begin(), _abFailoverQueue.end(),
for (int i = 0; i < _abFailoverQueue.size(); i++) { [this](const int a, const int b) {
int value_to_insert = _abFailoverQueue[i]; // Sort by failover score in descending order (highest score first)
int hole_position = i; return _paths[a].failoverScore > _paths[b].failoverScore;
while (hole_position > 0 && (_abFailoverQueue[hole_position - 1] > value_to_insert)) { });
_abFailoverQueue[hole_position] = _abFailoverQueue[hole_position - 1];
hole_position = hole_position - 1;
}
_abFailoverQueue[hole_position] = value_to_insert;
}
}*/
/** /**
* Short-circuit if we have no queued paths * Short-circuit if we have no queued paths