gateway/external/redis/redis.go
crusader cf875b8b32 ing
2018-04-09 20:37:54 +09:00

27 lines
407 B
Go

package redis
import (
"github.com/gomodule/redigo/redis"
)
var Pool *redis.Pool
func InitPackage() {
go func() {
Pool = &redis.Pool{
MaxIdle: 1,
MaxActive: 3,
IdleTimeout: 240,
Wait: true,
MaxConnLifetime: 1,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", "192.168.1.50:6379")
},
}
}()
}
func DestroyPackage() {
Pool.Close()
}