make copy before writing

This commit is contained in:
Asim Aslam 2019-02-04 10:29:10 +00:00
parent cead99ac44
commit 31b6cad47b

View File

@ -274,12 +274,18 @@ func (s *rpcServer) Register() error {
return err
}
// make copy of metadata
md := make(metadata.Metadata)
for k, v := range config.Metadata {
md[k] = v
}
// register service
node := &registry.Node{
Id: config.Name + "-" + config.Id,
Address: addr,
Port: port,
Metadata: config.Metadata,
Metadata: md,
}
node.Metadata["transport"] = config.Transport.String()