ExecuteInitConn runs the stored connection initialization function if available.
(ctx context.Context)
| 645 | |
| 646 | // ExecuteInitConn runs the stored connection initialization function if available. |
| 647 | func (cn *Conn) ExecuteInitConn(ctx context.Context) error { |
| 648 | if cn.initConnFunc != nil { |
| 649 | return cn.initConnFunc(ctx, cn) |
| 650 | } |
| 651 | return fmt.Errorf("redis: no initConnFunc set for conn[%d]", cn.GetID()) |
| 652 | } |
| 653 | |
| 654 | func (cn *Conn) SetNetConn(netConn net.Conn) { |
| 655 | // Store the new connection atomically first (lock-free) |
no test coverage detected