From e39891bbfd1d3c16eb028c8f3c7a52cc78f740fe Mon Sep 17 00:00:00 2001 From: Bruce Riley Date: Sun, 29 Jan 2023 15:27:56 +0000 Subject: [PATCH] Node: Move setting of scissors metrics up a line --- node/pkg/common/scissors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/pkg/common/scissors.go b/node/pkg/common/scissors.go index 5361e2275..7b43542e7 100644 --- a/node/pkg/common/scissors.go +++ b/node/pkg/common/scissors.go @@ -19,8 +19,8 @@ var ( // Start a go routine with recovering from any panic by sending an error to a error channel func RunWithScissors(ctx context.Context, errC chan error, name string, runnable supervisor.Runnable) { + ScissorsErrors.WithLabelValues("scissors", name).Add(0) go func() { - ScissorsErrors.WithLabelValues("scissors", name).Add(0) defer func() { if r := recover(); r != nil { switch x := r.(type) { @@ -41,8 +41,8 @@ func RunWithScissors(ctx context.Context, errC chan error, name string, runnable } func WrapWithScissors(runnable supervisor.Runnable, name string) supervisor.Runnable { + ScissorsErrors.WithLabelValues("scissors", name).Add(0) return func(ctx context.Context) (result error) { - ScissorsErrors.WithLabelValues("scissors", name).Add(0) defer func() { if r := recover(); r != nil { switch x := r.(type) {