diff --git a/backend/internal/storage/redis/client.go b/backend/internal/storage/redis/client.go index 9680e60..0da6614 100644 --- a/backend/internal/storage/redis/client.go +++ b/backend/internal/storage/redis/client.go @@ -14,15 +14,16 @@ func NewClient(url string) (*redis.Client, error) { return nil, fmt.Errorf("разбор URL: %w", err) } - opt.DialTimeout = 5 * time.Second - opt.ReadTimeout = 3 * time.Second - opt.WriteTimeout = 3 * time.Second - opt.MaxRetries = 2 + opt.DialTimeout = 700 * time.Millisecond + opt.ReadTimeout = 700 * time.Millisecond + opt.WriteTimeout = 700 * time.Millisecond + opt.MaxRetries = 1 opt.PoolSize = 10 + opt.ConnMaxIdleTime = time.Minute client := redis.NewClient(opt) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() if err := client.Ping(ctx).Err(); err != nil { _ = client.Close()