Skip to content

Commit beabb6e

Browse files
committed
Send Client SetInfo via pipe
1 parent 531f068 commit beabb6e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

redis.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,6 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
312312
// difficult to rely on error strings to determine all results.
313313
return err
314314
}
315-
if !c.opt.DisableIndentity {
316-
libName := ""
317-
libVer := Version()
318-
if c.opt.IdentitySuffix != "" {
319-
libName = c.opt.IdentitySuffix
320-
}
321-
libInfo := LibraryInfo{LibName: &libName}
322-
conn.ClientSetInfo(ctx, libInfo)
323-
libInfo = LibraryInfo{LibVer: &libVer}
324-
conn.ClientSetInfo(ctx, libInfo)
325-
}
326315
_, err := conn.Pipelined(ctx, func(pipe Pipeliner) error {
327316
if !auth && password != "" {
328317
if username != "" {
@@ -344,6 +333,18 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
344333
pipe.ClientSetName(ctx, c.opt.ClientName)
345334
}
346335

336+
if !c.opt.DisableIndentity {
337+
libName := ""
338+
libVer := Version()
339+
if c.opt.IdentitySuffix != "" {
340+
libName = c.opt.IdentitySuffix
341+
}
342+
libInfo := LibraryInfo{LibName: &libName}
343+
pipe.ClientSetInfo(ctx, libInfo)
344+
libInfo = LibraryInfo{LibVer: &libVer}
345+
pipe.ClientSetInfo(ctx, libInfo)
346+
}
347+
347348
return nil
348349
})
349350
if err != nil {

0 commit comments

Comments
 (0)