Skip to content

Commit

Permalink
make copy before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Feb 4, 2019
1 parent cead99a commit 31b6cad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 31b6cad

Please sign in to comment.