mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:54:44 +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",
|
Groups: "RC",
|
||||||
}, {
|
}, {
|
||||||
Name: "metrics_addr",
|
Name: "metrics_addr",
|
||||||
Default: []string{""},
|
Default: []string{},
|
||||||
Help: "IPaddress:Port or :Port to bind metrics server to",
|
Help: "IPaddress:Port or :Port to bind metrics server to",
|
||||||
Groups: "Metrics",
|
Groups: "Metrics",
|
||||||
}}.
|
}}.
|
||||||
|
@ -37,7 +37,7 @@ func init() {
|
|||||||
// If the server wasn't configured the *Server returned may be nil
|
// If the server wasn't configured the *Server returned may be nil
|
||||||
func MetricsStart(ctx context.Context, opt *rc.Options) (*MetricsServer, error) {
|
func MetricsStart(ctx context.Context, opt *rc.Options) (*MetricsServer, error) {
|
||||||
jobs.SetOpt(opt) // set the defaults for jobs
|
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
|
// Serve on the DefaultServeMux so can have global registrations appear
|
||||||
s, err := newMetricsServer(ctx, opt)
|
s, err := newMetricsServer(ctx, opt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user