File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -1750,19 +1750,12 @@ void Bond::processActiveBackupTasks(void* tPtr, int64_t now)
17501750 }
17511751 }
17521752 }
1753- /*
17541753 // Sort queue based on performance
1755- if (! _abFailoverQueue.empty()) {
1756- for (int i = 0; i < _abFailoverQueue.size(); i++) {
1757- int value_to_insert = _abFailoverQueue[i];
1758- int hole_position = i;
1759- while (hole_position > 0 && (_abFailoverQueue[hole_position - 1] > value_to_insert)) {
1760- _abFailoverQueue[hole_position] = _abFailoverQueue[hole_position - 1];
1761- hole_position = hole_position - 1;
1762- }
1763- _abFailoverQueue[hole_position] = value_to_insert;
1764- }
1765- }*/
1754+ std::sort (_abFailoverQueue.begin (), _abFailoverQueue.end (),
1755+ [this ](const int a, const int b) {
1756+ // Sort by failover score in descending order (highest score first)
1757+ return _paths[a].failoverScore > _paths[b].failoverScore ;
1758+ });
17661759
17671760 /* *
17681761 * Short-circuit if we have no queued paths
You can’t perform that action at this time.
0 commit comments