deprecated_overflow_gateway.../redis/pool.go
2017-09-11 13:42:52 +09:00

23 lines
385 B
Go

package redis
import (
"context"
"time"
"git.loafle.net/commons_go/config"
rp "git.loafle.net/commons_go/redis_pool"
)
func NewPool(ctx context.Context) rp.Pool {
h := &poolHandlers{
ctx: ctx,
}
h.cfg = config.Sub("redis")
h.MaxIdle = h.cfg.GetInt("pool.MaxIdle")
h.IdleTimeout = h.cfg.GetDuration("pool.IdleTimeout") * time.Second
p := rp.NewPool(ctx, h)
return p
}