Skip to content

Commit

Permalink
gateway: implement passthrough WithContextHint on `ipfsBackendWithM…
Browse files Browse the repository at this point in the history
…etrics`
  • Loading branch information
Jorropo committed Jan 12, 2024
1 parent bcb321c commit 3154a46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gateway/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ func (b *ipfsBackendWithMetrics) GetDNSLinkRecord(ctx context.Context, fqdn stri
}

var _ IPFSBackend = (*ipfsBackendWithMetrics)(nil)
var _ WithContextHint = (*ipfsBackendWithMetrics)(nil)

func (b *ipfsBackendWithMetrics) WrapContextForRequest(ctx context.Context) context.Context {
if withCtxWrap, ok := b.backend.(WithContextHint); ok {
return withCtxWrap.WrapContextForRequest(ctx)
}
return ctx
}

func newHandlerWithMetrics(c *Config, backend IPFSBackend) *handler {
i := &handler{
Expand Down

0 comments on commit 3154a46

Please sign in to comment.