From ceff4af1ac1490675221fa73560cadd7832300a6 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 22 Oct 2023 16:59:45 +0200 Subject: [PATCH] Disable log output from automaxprocs library --- changelog/unreleased/issue-4128 | 1 + cmd/restic/main.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/issue-4128 b/changelog/unreleased/issue-4128 index 7d331b6b3..4612b2366 100644 --- a/changelog/unreleased/issue-4128 +++ b/changelog/unreleased/issue-4128 @@ -6,3 +6,4 @@ on hosts with many CPU cores. https://github.com/restic/restic/issues/4128 https://github.com/restic/restic/pull/4485 +https://github.com/restic/restic/pull/4531 diff --git a/cmd/restic/main.go b/cmd/restic/main.go index 8b5e64f44..2159fb14f 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -10,7 +10,7 @@ import ( godebug "runtime/debug" "github.com/spf13/cobra" - _ "go.uber.org/automaxprocs" + "go.uber.org/automaxprocs/maxprocs" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" @@ -18,6 +18,11 @@ import ( "github.com/restic/restic/internal/restic" ) +func init() { + // don't import `go.uber.org/automaxprocs` to disable the log output + _, _ = maxprocs.Set() +} + // cmdRoot is the base command when no other command has been specified. var cmdRoot = &cobra.Command{ Use: "restic",