fix: manager redis config convert (#1680)
Signed-off-by: bigerous <cuidajun.cdj@alibaba-inc.com>
This commit is contained in:
parent
0272380541
commit
8e095a09c9
|
|
@ -567,7 +567,7 @@ func (cfg *Config) Validate() error {
|
|||
func (cfg *Config) Convert() error {
|
||||
// TODO Compatible with deprecated fields host and port.
|
||||
if len(cfg.Database.Redis.Addrs) == 0 && cfg.Database.Redis.Host != "" && cfg.Database.Redis.Port > 0 {
|
||||
cfg.Database.Redis.Addrs[0] = fmt.Sprintf("%s:%d", cfg.Database.Redis.Host, cfg.Database.Redis.Port)
|
||||
cfg.Database.Redis.Addrs = []string{fmt.Sprintf("%s:%d", cfg.Database.Redis.Host, cfg.Database.Redis.Port)}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ func (cfg *Config) Validate() error {
|
|||
func (cfg *Config) Convert() error {
|
||||
// TODO Compatible with deprecated fields host and port.
|
||||
if len(cfg.Job.Redis.Addrs) == 0 && cfg.Job.Redis.Host != "" && cfg.Job.Redis.Port > 0 {
|
||||
cfg.Job.Redis.Addrs[0] = fmt.Sprintf("%s:%d", cfg.Job.Redis.Host, cfg.Job.Redis.Port)
|
||||
cfg.Job.Redis.Addrs = []string{fmt.Sprintf("%s:%d", cfg.Job.Redis.Host, cfg.Job.Redis.Port)}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue