Skip to content

Commit

Permalink
feat(provider): adjustable MaxBatchSize limit (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo authored Oct 22, 2024
1 parent 7b7d634 commit 62b8ab7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions provider/reprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@ func DatastorePrefix(k datastore.Key) Option {
}
}

// MaxBatchSize limit how big each batch is.
// Some content routers like acceleratedDHTClient have sub linear scalling and
// bigger sizes are thus faster per elements however smaller batch sizes can
// limit memory usage spike.
func MaxBatchSize(n uint) Option {
return func(system *reprovider) error {
system.maxReprovideBatchSize = n
return nil
}
}

// ThroughputReport will fire the callback synchronously once at least limit
// multihashes have been advertised, it will then wait until a new set of at least
// limit multihashes has been advertised.
Expand Down

0 comments on commit 62b8ab7

Please sign in to comment.