Node: Move setting of scissors metrics up a line

This commit is contained in:
Bruce Riley 2023-01-29 15:27:56 +00:00 committed by Evan Gray
parent c585810766
commit e39891bbfd
1 changed files with 2 additions and 2 deletions

View File

@ -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) {