From 94f6838d19f852e042c79df3fe0a4206b80f1aa5 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 6 Jul 2022 15:35:57 +0200 Subject: [PATCH] [node] Fix: ensure that retrieve works for small files --- codex/node.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex/node.nim b/codex/node.nim index 8ae3a1c9..8f23bf47 100644 --- a/codex/node.nim +++ b/codex/node.nim @@ -132,7 +132,7 @@ proc retrieve*( ## try: let - batch = manifest.blocks.len div PrefetchBatch + batch = max(1, manifest.blocks.len div PrefetchBatch) trace "Prefetching in batches of", batch for blks in manifest.blocks.distribute(batch, true): discard await allFinished(