make copy before writing
This commit is contained in:
parent
cead99ac44
commit
31b6cad47b
@ -274,12 +274,18 @@ func (s *rpcServer) Register() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make copy of metadata
|
||||||
|
md := make(metadata.Metadata)
|
||||||
|
for k, v := range config.Metadata {
|
||||||
|
md[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
// register service
|
// register service
|
||||||
node := ®istry.Node{
|
node := ®istry.Node{
|
||||||
Id: config.Name + "-" + config.Id,
|
Id: config.Name + "-" + config.Id,
|
||||||
Address: addr,
|
Address: addr,
|
||||||
Port: port,
|
Port: port,
|
||||||
Metadata: config.Metadata,
|
Metadata: md,
|
||||||
}
|
}
|
||||||
|
|
||||||
node.Metadata["transport"] = config.Transport.String()
|
node.Metadata["transport"] = config.Transport.String()
|
||||||
|
Loading…
Reference in New Issue
Block a user