Skip to content

Commit d62e37b

Browse files
ncwyuval-cloudinary
authored andcommitted
rc: fix default value of --metrics-addr
Before this fix it was empty string, which isn't a good default for a stringArray.
1 parent 14be1ce commit d62e37b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/rc/rc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var OptionsInfo = fs.Options{{
8585
Groups: "RC",
8686
}, {
8787
Name: "metrics_addr",
88-
Default: []string{""},
88+
Default: []string{},
8989
Help: "IPaddress:Port or :Port to bind metrics server to",
9090
Groups: "Metrics",
9191
}}.

fs/rc/rcserver/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func init() {
3737
// If the server wasn't configured the *Server returned may be nil
3838
func MetricsStart(ctx context.Context, opt *rc.Options) (*MetricsServer, error) {
3939
jobs.SetOpt(opt) // set the defaults for jobs
40-
if opt.MetricsHTTP.ListenAddr[0] != "" {
40+
if len(opt.MetricsHTTP.ListenAddr) > 0 {
4141
// Serve on the DefaultServeMux so can have global registrations appear
4242
s, err := newMetricsServer(ctx, opt)
4343
if err != nil {

0 commit comments

Comments
 (0)