From 2648d50dcb0447516432867c111a5994513e08f1 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 6 Jan 2025 15:47:20 -0800 Subject: [PATCH] Remove extra call to get latest version. --- server/implementation/registry.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/server/implementation/registry.go b/server/implementation/registry.go index caf9d32..83d5ed1 100644 --- a/server/implementation/registry.go +++ b/server/implementation/registry.go @@ -348,13 +348,9 @@ func (s *DripStrictServerImplementation) SearchNodes(ctx context.Context, reques apiNodes := make([]drip.Node, 0, len(nodeResults.Nodes)) for _, dbNode := range nodeResults.Nodes { apiNode := mapper.DbNodeToApiNode(dbNode) - if dbNode.Edges.Versions != nil && len(dbNode.Edges.Versions) > 0 { - latestVersion, err := s.RegistryService.GetLatestNodeVersion(ctx, s.Client, dbNode.ID) - if err == nil { - apiNode.LatestVersion = mapper.DbNodeVersionToApiNodeVersion(latestVersion) - } else { - log.Ctx(ctx).Error().Msgf("Failed to get latest version for node %s w/ err: %v", dbNode.ID, err) - } + if len(dbNode.Edges.Versions) > 0 { + latestVersion := dbNode.Edges.Versions[0] + apiNode.LatestVersion = mapper.DbNodeVersionToApiNodeVersion(latestVersion) } apiNode.Publisher = mapper.DbPublisherToApiPublisher(dbNode.Edges.Publisher, false) apiNodes = append(apiNodes, *apiNode)