This commit is contained in:
Dmitry Zuikov 2023-01-25 05:43:43 +03:00
parent 3511003e66
commit bcb799f7e3
2 changed files with 3 additions and 3 deletions

View File

@ -303,7 +303,7 @@ runPeerM s bus p f = do
<*> liftIO (newTVarIO mempty) <*> liftIO (newTVarIO mempty)
let de = view envDeferred env let de = view envDeferred env
as <- liftIO $ replicateM 4 $ async $ runPipeline de as <- liftIO $ replicateM 8 $ async $ runPipeline de
sw <- liftIO $ async $ forever $ withPeerM env $ do sw <- liftIO $ async $ forever $ withPeerM env $ do
pause defSweepTimeout pause defSweepTimeout

View File

@ -84,7 +84,7 @@ blockChunksProto :: forall e m . ( MonadIO m
blockChunksProto adapter (BlockChunks c p) = blockChunksProto adapter (BlockChunks c p) =
case p of case p of
BlockGetAllChunks h size -> deferred proto do BlockGetAllChunks h size -> do
me <- ownPeer @e me <- ownPeer @e
who <- thatPeer proto who <- thatPeer proto
@ -96,7 +96,7 @@ blockChunksProto adapter (BlockChunks c p) =
let offsets' = calcChunks bsz (fromIntegral size) :: [(Offset, Size)] let offsets' = calcChunks bsz (fromIntegral size) :: [(Offset, Size)]
let offsets = zip offsets' [0..] let offsets = zip offsets' [0..]
for_ offsets $ \((o,sz),i) -> do for_ offsets $ \((o,sz),i) -> deferred proto do
chunk <- blkChunk adapter h o sz chunk <- blkChunk adapter h o sz
maybe (pure ()) (response_ . BlockChunk @e i) chunk maybe (pure ()) (response_ . BlockChunk @e i) chunk