Browse Source

use original server address string as map key

pull/2864/head
chrislu 3 years ago
parent
commit
daca2d22a5
  1. 2
      weed/command/master.go
  2. 2
      weed/pb/server_address.go

2
weed/command/master.go

@ -134,7 +134,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
masterPeers := make(map[string]pb.ServerAddress)
for _, peer := range peers {
masterPeers[peer.String()] = peer
masterPeers[string(peer)] = peer
}
r := mux.NewRouter()

2
weed/pb/server_address.go

@ -89,7 +89,7 @@ func (sa ServerAddresses) ToAddresses() (addresses []ServerAddress) {
func (sa ServerAddresses) ToAddressMap() (addresses map[string]ServerAddress) {
addresses = make(map[string]ServerAddress)
for _, address := range sa.ToAddresses() {
addresses[address.String()] = address
addresses[string(address)] = address
}
return
}

Loading…
Cancel
Save