little bit better

This commit is contained in:
Dmitry Zuikov 2023-01-27 11:07:38 +03:00
parent c2af04b79f
commit 2f4bfe1cfb
2 changed files with 6 additions and 5 deletions

View File

@ -297,7 +297,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

@ -159,8 +159,8 @@ runTestPeer p zu = do
stor <- simpleStorageInit opts stor <- simpleStorageInit opts
cww <- newChunkWriterIO stor (Just chDir) cww <- newChunkWriterIO stor (Just chDir)
sw <- liftIO $ replicateM 4 $ async $ simpleStorageWorker stor sw <- liftIO $ replicateM 32 $ async $ simpleStorageWorker stor
cw <- liftIO $ replicateM 4 $ async $ runChunkWriter cww cw <- liftIO $ replicateM 8 $ async $ runChunkWriter cww
zu stor cww zu stor cww
@ -404,8 +404,9 @@ blockDownloadLoop cw = do
if fromIntegral wrt >= thisBkSize then do if fromIntegral wrt >= thisBkSize then do
h1 <- liftIO $ getHash cw key h h1 <- liftIO $ getHash cw key h
if | h1 == Just h -> do if | h1 == Just h -> do
liftIO $ commitBlock cw key h pure ()
expire @e key -- liftIO $ commitBlock cw key h
-- expire @e key
| h1 /= Just h -> do | h1 /= Just h -> do
debug "block fucked" debug "block fucked"