From b3b8c2d13dc00b62af862e288cc4f47e27bde8e0 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Fri, 6 May 2022 05:37:20 -0700 Subject: [PATCH] Add and fix comments --- cmd/asynqmon/main.go | 7 ++++--- cmd/asynqmon/main_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/asynqmon/main.go b/cmd/asynqmon/main.go index dd2576a..efc0f1d 100644 --- a/cmd/asynqmon/main.go +++ b/cmd/asynqmon/main.go @@ -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 } diff --git a/cmd/asynqmon/main_test.go b/cmd/asynqmon/main_test.go index 82949d9..6d70082 100644 --- a/cmd/asynqmon/main_test.go +++ b/cmd/asynqmon/main_test.go @@ -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? }, }, {