[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" 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 ) ))