rc: disable the metrics server when running rclone rc

Fixes #8248
This commit is contained in:
hiddenmarten 2024-12-23 16:41:24 +01:00 committed by Nick Craig-Wood
parent dbb21165d4
commit 7c7606a6cf

View File

@ -429,11 +429,12 @@ func initConfig() {
fs.Fatalf(nil, "Failed to start remote control: %v", err) fs.Fatalf(nil, "Failed to start remote control: %v", err)
} }
// Start the metrics server if configured // Start the metrics server if configured and not running the "rc" command
_, err = rcserver.MetricsStart(ctx, &rc.Opt) if os.Args[1] != "rc" {
if err != nil { _, err = rcserver.MetricsStart(ctx, &rc.Opt)
fs.Fatalf(nil, "Failed to start metrics server: %v", err) if err != nil {
fs.Fatalf(nil, "Failed to start metrics server: %v", err)
}
} }
// Setup CPU profiling if desired // Setup CPU profiling if desired