// Setup Initialize the Redis instance
Setup Initialize the Redis instance
// Setup Initialize the Redis instance
func init() {
	RedisConn = &redis.Pool{
		MaxIdle:     500,
		MaxActive:   500,
		IdleTimeout: 200,
		Wait:        true,
		Dial: func() (redis.Conn, error) {
			c, err := redis.Dial("tcp", "127.0.0.1:6379")
			if err != nil {
				return nil, err
			}
			if _, err := c.Do("AUTH", "HYSH%&@3sd@KK"); err != nil {
				c.Close()
				return nil, err
			}
			return c, err
		},
		TestOnBorrow: func(c redis.Conn, t time.Time) error {
			_, err := c.Do("PING")
			return err
		},
	}
}
func init ( ) { RedisConn = & redis . Pool { MaxIdle : 500 , MaxActive : 500 , IdleTimeout : 200 , Wait : true , Dial : func ( ) ( redis . Conn , error ) { c , err := redis . Dial ( " " , " " ) if err != nil { return nil , err } if _ , err := c . Do ( " " , " " ) ; err != nil { c . Close ( ) return nil , err } return c , err } , TestOnBorrow : func ( c redis . Conn , t time . Time ) error { _ , err := c . Do ( " " ) return err } , } }
Setup Initialize the Redis instance
Setup Initialize the Redis instance