Skip to content

Commit

Permalink
refactor: refactor the key of the configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
OldSmokeGun committed Nov 27, 2023
1 parent 8f4b7b6 commit 26a30c8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deploy/kubernetes/values.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ configMap:
# redis:
# addr: "localhost:6379"
# password: ""
# db: 0 # database
# database: 0
# poolSize: 20 # the maximum number of the connection pool
# minIdleConns: 10 # minimum number of idle connections
# idleTimeout: 600 # amount of time after which client closes idle connections.
Expand Down
2 changes: 1 addition & 1 deletion etc/config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ services:
# redis:
# addr: "localhost:6379"
# password: ""
# db: 0 # database
# database: 0
# poolSize: 20 # the maximum number of the connection pool
# minIdleConns: 10 # minimum number of idle connections
# idleTimeout: 600 # amount of time after which client closes idle connections.
Expand Down
4 changes: 2 additions & 2 deletions internal/app/pkg/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func New(ctx context.Context, conf config.Redis) (*redis.Client, error) {
if conf.Password != "" {
option.Password = conf.Password
}
if conf.DB != 0 {
option.DB = conf.DB
if conf.Database != 0 {
option.DB = conf.Database
}
if conf.MaxRetries != 0 {
option.MaxRetries = conf.MaxRetries
Expand Down
2 changes: 1 addition & 1 deletion internal/config/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Redis struct {
Addr string `json:"addr"`
Username string `json:"username"`
Password string `json:"password"`
DB int `json:"db"`
Database int `json:"database"`
MaxRetries int `json:"maxRetries"`
MinRetryBackoff time.Duration `json:"minRetryBackoff"`
MaxRetryBackoff time.Duration `json:"maxRetryBackoff"`
Expand Down

0 comments on commit 26a30c8

Please sign in to comment.