diff --git a/connectionprovider.go b/connectionprovider.go index 14ad67b..e7c8c8c 100644 --- a/connectionprovider.go +++ b/connectionprovider.go @@ -80,7 +80,7 @@ func (c *PuddleConnectionProvider) Connection(ctx context.Context, endpoint *End func (c *PuddleConnectionProvider) obtainOrCreatePool(connectionKey, address string) *puddle.Pool[*grpc.ClientConn] { connectionPoolsMu.Lock() - pool, exists := connectionPools[address] + pool, exists := connectionPools[connectionKey] connectionPoolsMu.Unlock() if !exists { constructor := func(ctx context.Context) (*grpc.ClientConn, error) { @@ -115,7 +115,7 @@ func (c *PuddleConnectionProvider) obtainOrCreatePool(connectionKey, address str MaxSize: c.poolConnections, }) connectionPoolsMu.Lock() - connectionPools[address] = pool + connectionPools[connectionKey] = pool connectionPoolsMu.Unlock() }