Add and fix comments

This commit is contained in:
Ken Hibino 2022-05-06 05:37:20 -07:00
parent b7c2ebeff3
commit b3b8c2d13d
2 changed files with 5 additions and 4 deletions

View File

@ -20,8 +20,7 @@ import (
"github.com/rs/cors"
)
// Config holds configurations for the running program
// provided by the user via command line.
// Config holds configurations for the program provided via the command line.
type Config struct {
// Server port
Port int
@ -126,7 +125,9 @@ func makeRedisConnOpt(cfg *Config) (asynq.RedisConnOpt, error) {
connOpt.DB = cfg.RedisDB
connOpt.Password = cfg.RedisPassword
}
connOpt.TLSConfig = makeTLSConfig(cfg)
if connOpt.TLSConfig == nil {
connOpt.TLSConfig = makeTLSConfig(cfg)
}
return connOpt, nil
}

View File

@ -106,7 +106,7 @@ func TestMakeRedisConnOpt(t *testing.T) {
MasterName: "mymaster",
SentinelAddrs: []string{
"localhost:5000", "localhost:5001", "localhost:5002"},
Password: "secretpassword",
Password: "secretpassword", // FIXME: Shouldn't this be SentinelPassword instead?
},
},
{