Skip to content

Commit 097af00

Browse files
authored
Merge pull request #712 from LawyZheng/master
Fix Bug 'Can't Connect to Redis' (Fix #708)
2 parents 1a17917 + 5aa7f01 commit 097af00

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commands/command.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/url"
99
"os"
1010
"path/filepath"
11+
"strconv"
1112
"strings"
1213
"time"
1314

@@ -398,15 +399,15 @@ func RegisterCache() {
398399
var redisConfig struct {
399400
Conn string `json:"conn"`
400401
Password string `json:"password"`
401-
DbNum int `json:"dbNum"`
402+
DbNum string `json:"dbNum"`
402403
}
403-
redisConfig.DbNum = 0
404+
redisConfig.DbNum = "0"
404405
redisConfig.Conn = web.AppConfig.DefaultString("cache_redis_host", "")
405406
if pwd := web.AppConfig.DefaultString("cache_redis_password", ""); pwd != "" {
406407
redisConfig.Password = pwd
407408
}
408409
if dbNum := web.AppConfig.DefaultInt("cache_redis_db", 0); dbNum > 0 {
409-
redisConfig.DbNum = dbNum
410+
redisConfig.DbNum = strconv.Itoa(dbNum)
410411
}
411412

412413
bc, err := json.Marshal(&redisConfig)

0 commit comments

Comments
 (0)