make copy before writing
This commit is contained in:
parent
cead99ac44
commit
31b6cad47b
@ -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 := ®istry.Node{
|
||||
Id: config.Name + "-" + config.Id,
|
||||
Address: addr,
|
||||
Port: port,
|
||||
Metadata: config.Metadata,
|
||||
Metadata: md,
|
||||
}
|
||||
|
||||
node.Metadata["transport"] = config.Transport.String()
|
||||
|
Loading…
x
Reference in New Issue
Block a user