Skip to content

Commit

Permalink
Refactor internal/net/grpc/client.go
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango committed Oct 4, 2024
1 parent 4c5caca commit 316bc09
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/net/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ package grpc

import (
"context"
"maps"
"math"
"slices"
"sync/atomic"
"time"

Expand Down Expand Up @@ -155,11 +157,7 @@ func (g *gRPCClient) StartConnectionMonitor(ctx context.Context) (<-chan error,
}
g.monitorRunning.Store(true)

addrs := make([]string, 0, len(g.addrs))
for addr := range g.addrs {
addrs = append(addrs, addr)
}

addrs := slices.Collect(maps.Keys(g.addrs))

Check warning on line 160 in internal/net/grpc/client.go

View check run for this annotation

Codecov / codecov/patch

internal/net/grpc/client.go#L160

Added line #L160 was not covered by tests
if g.dialer != nil {
g.dialer.StartDialerCache(ctx)
}
Expand Down

0 comments on commit 316bc09

Please sign in to comment.