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

View File

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