Skip to content

Commit

Permalink
Merge pull request #25 from aloware/feature/sort-queues-and-partition…
Browse files Browse the repository at this point in the history
…s-by-name

Sort By Name in Queues and Partitions Page
  • Loading branch information
hamed-aloware authored Jul 12, 2022
2 parents 262bc1e + b5f6b95 commit 5fb51b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Repositories/RedisRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private function queuesWithPartitionsPrivate(
}

usort($queues, function ($a, $b) {
return ($b['partitions_count'] < $a['partitions_count']) ? 1 : -1;
return ($b['queue'] < $a['queue']) ? 1 : -1;
});

return $queues;
Expand Down Expand Up @@ -434,6 +434,10 @@ private function partitionsWithCountPrivate(
$partitions[] = $item;
}

usort($partitions, function ($a, $b) {
return ($b['name'] < $a['name']) ? 1 : -1;
});

return $partitions;
}

Expand Down

0 comments on commit 5fb51b4

Please sign in to comment.