Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
f2eb7e7891
2 changed files with 2 additions and 3 deletions
  1. +1
    -1
      app/cfg/init_cache.go
  2. +1
    -2
      app/utils/cache/redis.go

+ 1
- 1
app/cfg/init_cache.go View File

@@ -5,5 +5,5 @@ import (
)

func InitCache() {
cache.NewRedis(RedisAddr, RedisPassword)
cache.NewRedis(RedisAddr)
}

+ 1
- 2
app/utils/cache/redis.go View File

@@ -36,7 +36,7 @@ type Config struct {
var pool *redigo.Pool
var conf *Config

func NewRedis(addr, password string) {
func NewRedis(addr string) {
if addr == "" {
panic("\nredis connect string cannot be empty\n")
}
@@ -48,7 +48,6 @@ func NewRedis(addr, password string) {
Wait: true,
Dial: func() (redigo.Conn, error) {
c, err := redigo.Dial("tcp", addr,
redigo.DialPassword(password),
redigo.DialConnectTimeout(redisDialTTL),
redigo.DialReadTimeout(redisReadTTL),
redigo.DialWriteTimeout(redisWriteTTL),


Loading…
Cancel
Save