[node] rename PrefetchBatch -> Batch
Reason: in a next commit we'll use the same constant to fetch data in batches
This commit is contained in:
parent
d4025f4a5f
commit
7bc5280596
|
@ -35,7 +35,7 @@ logScope:
|
||||||
topics = "codex node"
|
topics = "codex node"
|
||||||
|
|
||||||
const
|
const
|
||||||
PrefetchBatch = 100
|
FetchBatch = 100
|
||||||
|
|
||||||
type
|
type
|
||||||
CodexError = object of CatchableError
|
CodexError = object of CatchableError
|
||||||
|
@ -86,8 +86,8 @@ proc retrieve*(
|
||||||
##
|
##
|
||||||
try:
|
try:
|
||||||
let
|
let
|
||||||
batch = max(1, manifest.blocks.len div PrefetchBatch)
|
batch = max(1, manifest.blocks.len div FetchBatch)
|
||||||
trace "Prefetching in batches of", batch
|
trace "Prefetching in batches of", FetchBatch
|
||||||
for blks in manifest.blocks.distribute(batch, true):
|
for blks in manifest.blocks.distribute(batch, true):
|
||||||
discard await allFinished(
|
discard await allFinished(
|
||||||
blks.mapIt( node.blockStore.getBlock( it ) ))
|
blks.mapIt( node.blockStore.getBlock( it ) ))
|
||||||
|
|
Loading…
Reference in New Issue