Skip to content

Commit

Permalink
rename options
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Nov 22, 2024
1 parent 4b48c08 commit f6d672a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bitswap/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func New(parent context.Context, network bsnet.BitSwapNetwork, bstore blockstore
bpm := bsbpm.New()
pm := bspm.New(ctx, peerQueueFactory, network.Self())
pqm := bspqm.New(ctx, network,
bspqm.WithMaxConcurrentFinds(opts.pqmMaxConcurrentFinds),
bspqm.WithMaxProvidersPerFind(opts.pqmMaxProvidersPerFind))
bspqm.WithMaxConcurrentFinds(opts.maxConcurrentFinds),
bspqm.WithMaxProvidersPerFind(opts.maxProvidersPerFind))

sessionFactory := func(
sessctx context.Context,
Expand Down
12 changes: 6 additions & 6 deletions bitswap/client/optios.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type clientConfig struct {
tracer tracer.Tracer

// ProviderQueryManager options.
pqmMaxConcurrentFinds int
pqmMaxProvidersPerFind int
maxConcurrentFinds int
maxProvidersPerFind int
}

// Option defines the functional option type that can be used to configure
Expand Down Expand Up @@ -92,14 +92,14 @@ func WithoutDuplicatedBlockStats() Option {
}
}

func WithPQMMaxConcurrentFinds(n int) Option {
func WithMaxConcurrentFinds(n int) Option {
return func(c *clientConfig) {
c.pqmMaxConcurrentFinds = n
c.maxConcurrentFinds = n
}
}

func WithPQMMaxProvidersPerFind(n int) Option {
func WithMaxProvidersPerFind(n int) Option {
return func(c *clientConfig) {
c.pqmMaxProvidersPerFind = n
c.maxProvidersPerFind = n
}
}

0 comments on commit f6d672a

Please sign in to comment.