From c6b1cadc0214c6791a5c5bcc62ab57601e38f457 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 13 八月 2020 11:31:08 +0800
Subject: [PATCH] add db restriction
---
cache/redis.go | 50 +++++++++++++++++++++++++-------------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/cache/redis.go b/cache/redis.go
index 9598272..4d55345 100644
--- a/cache/redis.go
+++ b/cache/redis.go
@@ -1,26 +1,26 @@
package cache
-
-import (
- "fmt"
- "github.com/astaxie/beego"
- redigo "github.com/gomodule/redigo/redis"
-)
-
-var pool *redigo.Pool
-
-func init() {
- redisHost := beego.AppConfig.String("redisIp")
- redisPort := beego.AppConfig.String("redisPort")
- poolSize := 20
- pool = redigo.NewPool(func() (redigo.Conn, error) {
- c, err := redigo.Dial("tcp", fmt.Sprintf("%s:%d", redisHost, redisPort))
- if err != nil {
- return nil, err
- }
- return c, nil
- }, poolSize)
-}
-
-func Get() redigo.Conn {
- return pool.Get()
-}
\ No newline at end of file
+//
+//import (
+// "fmt"
+// "github.com/astaxie/beego"
+// redigo "github.com/gomodule/redigo/redis"
+//)
+//
+//var pool *redigo.Pool
+//
+//func init() {
+// redisHost := beego.AppConfig.String("redisIp")
+// redisPort,_ := beego.AppConfig.Int("redisPort")
+// poolSize := 20
+// pool = redigo.NewPool(func() (redigo.Conn, error) {
+// c, err := redigo.Dial("tcp", fmt.Sprintf("%s:%d", redisHost, redisPort))
+// if err != nil {
+// return nil, err
+// }
+// return c, nil
+// }, poolSize)
+//}
+//
+//func Get() redigo.Conn {
+// return pool.Get()
+//}
\ No newline at end of file
--
Gitblit v1.8.0