From 4b30d8733e911d2e8303fb0abdb784e180736d55 Mon Sep 17 00:00:00 2001 From: NEEXP <83204594+NEEXP@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:37:26 +0800 Subject: [PATCH 1/2] fix: typo: prot -> port Fix Redis configuration typo. --- README.md | 2 +- config/app.prod.json | 2 +- config/config.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80256d1..4508f86 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ vi (app.json or app.dev.json or app.prod.json) }, "Redis": { "Host": "127.0.0.1", - "Prot": 6379, + "Port": 6379, "DBIndex": 0, "UserName": "", "Password": "" diff --git a/config/app.prod.json b/config/app.prod.json index 07dda25..8aa921b 100644 --- a/config/app.prod.json +++ b/config/app.prod.json @@ -13,7 +13,7 @@ }, "Redis": { "Host": "127.0.0.1", - "Prot": 6379, + "Port": 6379, "DBIndex": 0, "UserName": "", "Password": "" diff --git a/config/config.go b/config/config.go index 02926ee..f5fb461 100644 --- a/config/config.go +++ b/config/config.go @@ -73,7 +73,7 @@ type dbConfigObj struct { } type redisConfig struct { Host string - Prot uint + Port uint DBIndex uint UserName string Password string From 056cf5fa4acd938c942473f926ed6f2f6cf929a3 Mon Sep 17 00:00:00 2001 From: rn-h Date: Thu, 19 Sep 2024 15:17:52 +0800 Subject: [PATCH 2/2] Update redis.go --- db/redis/redis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/redis/redis.go b/db/redis/redis.go index b7f1bed..7fda665 100644 --- a/db/redis/redis.go +++ b/db/redis/redis.go @@ -22,7 +22,7 @@ func GetRedis() (redisD *redis.Client, err error) { } redisConfig := config.GetConfig().Redis redisDB = redis.NewClient(&redis.Options{ - Addr: redisConfig.Host + ":" + strconv.Itoa(int(redisConfig.Prot)), + Addr: redisConfig.Host + ":" + strconv.Itoa(int(redisConfig.Port)), Username: redisConfig.UserName, Password: redisConfig.Password, DB: int(redisConfig.DBIndex),