[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:
Mark Spanbroek 2022-07-07 15:01:29 +02:00 committed by markspanbroek
parent d4025f4a5f
commit 7bc5280596
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ logScope:
topics = "codex node"
const
PrefetchBatch = 100
FetchBatch = 100
type
CodexError = object of CatchableError
@ -86,8 +86,8 @@ proc retrieve*(
##
try:
let
batch = max(1, manifest.blocks.len div PrefetchBatch)
trace "Prefetching in batches of", batch
batch = max(1, manifest.blocks.len div FetchBatch)
trace "Prefetching in batches of", FetchBatch
for blks in manifest.blocks.distribute(batch, true):
discard await allFinished(
blks.mapIt( node.blockStore.getBlock( it ) ))