Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
fix default Host
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalan committed Dec 12, 2020
1 parent e0e3962 commit 26bbcc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storageredis.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ func (rd *RedisStorage) Provision(ctx caddy.Context) error {
// GetConfigValue get Config value from env, if already been set by Caddyfile, don't overwrite
func (rd *RedisStorage) GetConfigValue() {
rd.Logger.Debugf("GetConfigValue [%s]:%s", "pre", rd)
rd.Host = configureString(rd.Host, EnvNameRedisHost, DefaultRedisHost)
rd.Port = configureString(rd.Port, EnvNameRedisPort, DefaultRedisPort)
rd.DB = configureInt(rd.DB, EnvNameRedisDB, DefaultRedisDB)
rd.Timeout = configureInt(rd.Timeout, EnvNameRedisTimeout, DefaultRedisTimeout)
Expand Down Expand Up @@ -528,8 +529,8 @@ var (
)

func (rd RedisStorage) String() string {
json, _ := json.Marshal(rd)
return string(json)
strVal, _ := json.Marshal(rd)
return string(strVal)
}

func configureBool(value bool, envVariableName string, valueDefault bool) bool {
Expand Down

0 comments on commit 26bbcc8

Please sign in to comment.