49 Star 108 Fork 12

喵了个咪 / phalgo

redis new 了就close了

Backlog
MrJ  Opened this issue
// 初始化Redis连接
func NewRedis(redisdb string) {
	var err error

	Config.SetDefault(redisdb, map[string]interface{}{
		"network"    : "tcp",
		"address"    : "127.0.0.1:6379",
		"password"   : "",
	})

	Redis, err = redis.Dial(Config.GetString(redisdb + ".network"), Config.GetString(redisdb + ".address"), redis.DialPassword(Config.GetString(redisdb + ".password")), redis.DialDatabase(0))
	if err != nil {
		print(err)
	}
	defer Redis.Close()
    
        // redis new 了就close了
}
617134 wocaa 1578929302 total 1 participants

Comments (0)

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Go
1
https://git.oschina.net/wenzhenxi/phalgo.git
git@git.oschina.net:wenzhenxi/phalgo.git
wenzhenxi
phalgo
phalgo

Search