mirror of
https://github.com/rclone/rclone.git
synced 2024-11-21 16:03:29 +01:00
rc: fix default value of --metrics-addr
Before this fix it was empty string, which isn't a good default for a stringArray.
This commit is contained in:
parent
fef1b61585
commit
3af757e26d
@ -85,7 +85,7 @@ var OptionsInfo = fs.Options{{
|
||||
Groups: "RC",
|
||||
}, {
|
||||
Name: "metrics_addr",
|
||||
Default: []string{""},
|
||||
Default: []string{},
|
||||
Help: "IPaddress:Port or :Port to bind metrics server to",
|
||||
Groups: "Metrics",
|
||||
}}.
|
||||
|
@ -37,7 +37,7 @@ func init() {
|
||||
// If the server wasn't configured the *Server returned may be nil
|
||||
func MetricsStart(ctx context.Context, opt *rc.Options) (*MetricsServer, error) {
|
||||
jobs.SetOpt(opt) // set the defaults for jobs
|
||||
if opt.MetricsHTTP.ListenAddr[0] != "" {
|
||||
if len(opt.MetricsHTTP.ListenAddr) > 0 {
|
||||
// Serve on the DefaultServeMux so can have global registrations appear
|
||||
s, err := newMetricsServer(ctx, opt)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user