Browse Source

fix same dc and other dc

pull/2454/head
Chris Lu 3 years ago
parent
commit
3d87aa767d
  1. 4
      weed/wdclient/vid_map.go

4
weed/wdclient/vid_map.go

@ -73,9 +73,9 @@ func (vc *vidMap) LookupVolumeServerUrl(vid string) (serverUrls []string, err er
var sameDcServers, otherDcServers []string var sameDcServers, otherDcServers []string
for _, loc := range locations { for _, loc := range locations {
if vc.DataCenter == "" || loc.DataCenter == "" || vc.DataCenter != loc.DataCenter { if vc.DataCenter == "" || loc.DataCenter == "" || vc.DataCenter != loc.DataCenter {
sameDcServers = append(sameDcServers, loc.Url)
} else {
otherDcServers = append(otherDcServers, loc.Url) otherDcServers = append(otherDcServers, loc.Url)
} else {
sameDcServers = append(sameDcServers, loc.Url)
} }
} }
rand.Shuffle(len(sameDcServers), func(i, j int) { rand.Shuffle(len(sameDcServers), func(i, j int) {

Loading…
Cancel
Save