Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 91355b0

Browse files
authored
Fix see redundant connector caching. (#151)
Signed-off-by: minsugn Son <[email protected]>
1 parent 9c426dc commit 91355b0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pkg/fab/comm/connector.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,13 @@ func (cc *CachingConnector) DialContext(ctx context.Context, target string, opts
114114
logger.Debugf("DialContext: %s", target)
115115

116116
cc.lock.Lock()
117-
c, ok := cc.loadConn(target)
118-
if !ok {
119-
createdConn, err := cc.createConn(ctx, target, opts...)
120-
if err != nil {
121-
cc.lock.Unlock()
122-
return nil, errors.WithMessage(err, "connection creation failed")
123-
}
124-
c = createdConn
117+
118+
createdConn, err := cc.createConn(ctx, target, opts...)
119+
if err != nil {
120+
cc.lock.Unlock()
121+
return nil, errors.WithMessage(err, "connection creation failed")
125122
}
123+
c := createdConn
126124

127125
cc.lock.Unlock()
128126

0 commit comments

Comments
 (0)