From 2f4bfe1cfb1e8110c0940211790c2e9a484d44ff Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Fri, 27 Jan 2023 11:07:38 +0300 Subject: [PATCH] little bit better --- hbs2-core/lib/HBS2/Actors/Peer.hs | 2 +- hbs2-tests/test/Peer2Main.hs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hbs2-core/lib/HBS2/Actors/Peer.hs b/hbs2-core/lib/HBS2/Actors/Peer.hs index 831875fa..0a33c89f 100644 --- a/hbs2-core/lib/HBS2/Actors/Peer.hs +++ b/hbs2-core/lib/HBS2/Actors/Peer.hs @@ -297,7 +297,7 @@ runPeerM s bus p f = do <*> liftIO (newTVarIO mempty) 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 pause defSweepTimeout diff --git a/hbs2-tests/test/Peer2Main.hs b/hbs2-tests/test/Peer2Main.hs index e5489651..db4621e3 100644 --- a/hbs2-tests/test/Peer2Main.hs +++ b/hbs2-tests/test/Peer2Main.hs @@ -159,8 +159,8 @@ runTestPeer p zu = do stor <- simpleStorageInit opts cww <- newChunkWriterIO stor (Just chDir) - sw <- liftIO $ replicateM 4 $ async $ simpleStorageWorker stor - cw <- liftIO $ replicateM 4 $ async $ runChunkWriter cww + sw <- liftIO $ replicateM 32 $ async $ simpleStorageWorker stor + cw <- liftIO $ replicateM 8 $ async $ runChunkWriter cww zu stor cww @@ -404,8 +404,9 @@ blockDownloadLoop cw = do if fromIntegral wrt >= thisBkSize then do h1 <- liftIO $ getHash cw key h if | h1 == Just h -> do - liftIO $ commitBlock cw key h - expire @e key + pure () + -- liftIO $ commitBlock cw key h + -- expire @e key | h1 /= Just h -> do debug "block fucked"