22 lines
		
	
	
		
			374 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			374 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package redis
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"time"
 | |
| 
 | |
| 	rp "git.loafle.net/commons_go/redis_pool"
 | |
| 	"git.loafle.net/overflow/overflow_gateway_probe/conf"
 | |
| )
 | |
| 
 | |
| 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
 | |
| }
 |