Browse Source

redisc update

marion 4 years ago
parent
commit
e7090738b7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      utils/redis/redis_conn.go

+ 2 - 0
utils/redis/redis_conn.go

@@ -59,6 +59,8 @@ func (h *Hub) createPool(addr string, opts ...redis.DialOption) (*redis.Pool, er
 func (h *Hub) conn() error {
 	dialOpts := []redis.DialOption{
 		redis.DialConnectTimeout(5 * time.Second),
+		redis.DialReadTimeout(500 * time.Millisecond),
+		redis.DialWriteTimeout(500 * time.Millisecond),
 	}
 
 	nodes := viper.GetStringSlice("redis.nodes")