Node: Move setting of scissors metrics up a line
This commit is contained in:
parent
c585810766
commit
e39891bbfd
|
@ -19,8 +19,8 @@ var (
|
||||||
|
|
||||||
// Start a go routine with recovering from any panic by sending an error to a error channel
|
// 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) {
|
func RunWithScissors(ctx context.Context, errC chan error, name string, runnable supervisor.Runnable) {
|
||||||
go func() {
|
|
||||||
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
|
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
|
||||||
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
switch x := r.(type) {
|
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 {
|
func WrapWithScissors(runnable supervisor.Runnable, name string) supervisor.Runnable {
|
||||||
return func(ctx context.Context) (result error) {
|
|
||||||
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
|
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
|
||||||
|
return func(ctx context.Context) (result error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
switch x := r.(type) {
|
switch x := r.(type) {
|
||||||
|
|
Loading…
Reference in New Issue