Skip to content

Commit

Permalink
fix: replace singleflight
Browse files Browse the repository at this point in the history
  • Loading branch information
metacertain committed Jun 9, 2021
1 parent 2004491 commit 695324e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/retrieval/retrieval.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/ethersphere/bee/pkg/topology"
"github.com/ethersphere/bee/pkg/tracing"
"github.com/opentracing/opentracing-go"
"golang.org/x/sync/singleflight"
"resenje.org/singleflight"
)

type requestSourceContextKey struct{}
Expand Down Expand Up @@ -108,7 +108,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, addr swarm.Address, origin
flightRoute = addr.String() + originSuffix
}

v, err, _ := s.singleflight.Do(flightRoute, func() (interface{}, error) {
v, _, err := s.singleflight.Do(ctx, flightRoute, func(ctx context.Context) (interface{}, error) {

maxPeers := 1
if origin {
Expand Down

0 comments on commit 695324e

Please sign in to comment.