Commit 4b7cef9 1 parent d337b7f commit 4b7cef9 Copy full SHA for 4b7cef9
File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,17 @@ func DatastorePrefix(k datastore.Key) Option {
183
183
}
184
184
}
185
185
186
+ // MaxBatchSize limit how big each batch is.
187
+ // Some content routers like acceleratedDHTClient have sub linear scalling and
188
+ // bigger sizes are thus faster per elements however smaller batch sizes can
189
+ // limit memory usage spike.
190
+ func MaxBatchSize (n uint ) Option {
191
+ return func (system * reprovider ) error {
192
+ system .maxReprovideBatchSize = n
193
+ return nil
194
+ }
195
+ }
196
+
186
197
// ThroughputReport will fire the callback synchronously once at least limit
187
198
// multihashes have been advertised, it will then wait until a new set of at least
188
199
// limit multihashes has been advertised.
You can’t perform that action at this time.
0 commit comments