Skip to content

Commit

Permalink
fix panic in initialisation due to metrics_sender lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Oct 21, 2024
1 parent 19b5c6c commit 7d5ee9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions metering/metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ func (ms *MetricsSender) Send(ctx context.Context, userID, apiKeyID, ip, userMet
}

func WithMetricsSender(ctx context.Context) context.Context {
//check if already set
if GetMetricsSender(ctx) != nil {
if _, ok := ctx.Value("metrics_sender").(*MetricsSender); ok {
return ctx
}

Expand Down

0 comments on commit 7d5ee9d

Please sign in to comment.