24 lines
374 B
Go
24 lines
374 B
Go
package redis
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.loafle.net/overflow/overflow_gateway_web/conf"
|
|
|
|
rp "git.loafle.net/commons_go/redis_pool"
|
|
)
|
|
|
|
func NewPool(ctx context.Context) rp.Pool {
|
|
h := &poolHandlers{
|
|
ctx: ctx,
|
|
}
|
|
|
|
h.MaxIdle = conf.Config.Redis.Pool.MaxIdle
|
|
h.IdleTimeout = conf.Config.Redis.Pool.IdleTimeout * time.Second
|
|
|
|
p := rp.NewPool(ctx, h)
|
|
|
|
return p
|
|
}
|