Skip to content

Commit

Permalink
chore: cleanup deprecated calls
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarvardt committed Nov 25, 2023
1 parent 4f14f07 commit 8854c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/noop"
noopM "go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/trace"
noopT "go.opentelemetry.io/otel/trace/noop"
"go.uber.org/multierr"
"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -112,8 +113,8 @@ func NewWorker(c *Client, wm WorkMap, options ...WorkerOption) (*Worker, error)
wm: wm,
logger: adapter.NoOpLogger{},
pollStrategy: PriorityPollStrategy,
tracer: trace.NewNoopTracerProvider().Tracer("noop"),
meter: noop.NewMeterProvider().Meter("noop"),
tracer: noopT.NewTracerProvider().Tracer("noop"),
meter: noopM.NewMeterProvider().Meter("noop"),

panicStackBufSize: defaultPanicStackBufSize,
}
Expand Down Expand Up @@ -410,8 +411,8 @@ func NewWorkerPool(c *Client, wm WorkMap, poolSize int, options ...WorkerPoolOpt
workers: make([]*Worker, poolSize),
logger: adapter.NoOpLogger{},
pollStrategy: PriorityPollStrategy,
tracer: trace.NewNoopTracerProvider().Tracer("noop"),
meter: noop.NewMeterProvider().Meter("noop"),
tracer: noopT.NewTracerProvider().Tracer("noop"),
meter: noopM.NewMeterProvider().Meter("noop"),

panicStackBufSize: defaultPanicStackBufSize,
}
Expand Down
4 changes: 2 additions & 2 deletions worker_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/trace"
noopT "go.opentelemetry.io/otel/trace/noop"

"github.com/vgarvardt/gue/v5/adapter"
)
Expand Down Expand Up @@ -209,7 +209,7 @@ func TestWithPoolPollStrategy(t *testing.T) {
}

func TestWithPoolTracer(t *testing.T) {
customTracer := trace.NewNoopTracerProvider().Tracer("custom")
customTracer := noopT.NewTracerProvider().Tracer("custom")

workerPoolWithTracer, err := NewWorkerPool(nil, dummyWM, 2, WithPoolTracer(customTracer))
require.NoError(t, err)
Expand Down

0 comments on commit 8854c30

Please sign in to comment.