1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00

Fix a problem with the Register Memory component (#2545)

This commit is contained in:
刘志铭 2022-08-13 18:23:42 +08:00 committed by GitHub
parent f40cfdda82
commit d7d8123bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,15 +172,15 @@ func (m *memRegistry) Register(s *Service, opts ...RegisterOption) error {
metadata := make(map[string]string) metadata := make(map[string]string)
for k, v := range n.Metadata { for k, v := range n.Metadata {
metadata[k] = v metadata[k] = v
m.records[s.Name][s.Version].Nodes[n.Id] = &node{ }
Node: &Node{ m.records[s.Name][s.Version].Nodes[n.Id] = &node{
Id: n.Id, Node: &Node{
Address: n.Address, Id: n.Id,
Metadata: metadata, Address: n.Address,
}, Metadata: metadata,
TTL: options.TTL, },
LastSeen: time.Now(), TTL: options.TTL,
} LastSeen: time.Now(),
} }
} }
} }