mirror of
https://github.com/pgsty/minio.git
synced 2026-10-08 18:55:58 +03:00
Improve connectDisks() performance (#9203)
This commit is contained in:
+5
-4
@@ -24,12 +24,13 @@ import (
|
||||
)
|
||||
|
||||
// getLoadBalancedDisks - fetches load balanced (sufficiently randomized) disk slice.
|
||||
func (xl xlObjects) getLoadBalancedDisks() (disks []StorageAPI) {
|
||||
func (xl xlObjects) getLoadBalancedDisks() (newDisks []StorageAPI) {
|
||||
disks := xl.getDisks()
|
||||
// Based on the random shuffling return back randomized disks.
|
||||
for _, i := range hashOrder(UTCNow().String(), len(xl.getDisks())) {
|
||||
disks = append(disks, xl.getDisks()[i-1])
|
||||
for _, i := range hashOrder(UTCNow().String(), len(disks)) {
|
||||
newDisks = append(newDisks, disks[i-1])
|
||||
}
|
||||
return disks
|
||||
return newDisks
|
||||
}
|
||||
|
||||
// This function does the following check, suppose
|
||||
|
||||
Reference in New Issue
Block a user