mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
eef460c439
commit
6a4503e4a3
|
@ -112,7 +112,7 @@ runChunkWriter2 w = do
|
||||||
stop <- liftIO $ readTVarIO (stopped w)
|
stop <- liftIO $ readTVarIO (stopped w)
|
||||||
|
|
||||||
if stop then do
|
if stop then do
|
||||||
ks <- liftIO $ take 20 <$> Cache.keys cache
|
ks <- liftIO $ take 100 <$> Cache.keys cache
|
||||||
liftIO $ for_ ks $ \k -> flush w k
|
liftIO $ for_ ks $ \k -> flush w k
|
||||||
else do
|
else do
|
||||||
ks <- liftIO $ Cache.keys cache
|
ks <- liftIO $ Cache.keys cache
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
cradle:
|
||||||
|
cabal:
|
||||||
|
- path: "test/Peer2Main.hs"
|
||||||
|
component: "hbs2-tests:exe:test-peer-run"
|
|
@ -224,10 +224,11 @@ blockDownloadLoop cw = do
|
||||||
|
|
||||||
fix \next -> do
|
fix \next -> do
|
||||||
|
|
||||||
|
-- debug $ "WIP:" <+> pretty wip
|
||||||
|
|
||||||
job <- liftIO $ atomically $ Q.readTBQueue blq
|
job <- liftIO $ atomically $ Q.readTBQueue blq
|
||||||
wip <- liftIO $ blocksInProcess cw
|
wip <- liftIO $ blocksInProcess cw
|
||||||
|
|
||||||
debug $ "WIP:" <+> pretty wip
|
|
||||||
|
|
||||||
if wip > 10 then do
|
if wip > 10 then do
|
||||||
pause ( 1 :: Timeout 'Seconds )
|
pause ( 1 :: Timeout 'Seconds )
|
||||||
|
@ -445,6 +446,12 @@ main = do
|
||||||
|
|
||||||
our <- async $ runTestPeer p0 $ \s cw -> do
|
our <- async $ runTestPeer p0 $ \s cw -> do
|
||||||
let blk = hasBlock s
|
let blk = hasBlock s
|
||||||
|
|
||||||
|
void $ async $ forever $ do
|
||||||
|
pause ( 1 :: Timeout 'Seconds )
|
||||||
|
wip <- blocksInProcess cw
|
||||||
|
debug $ "blocks wip:" <+> pretty wip
|
||||||
|
|
||||||
runPeerM (AnyStorage s) fake p0 $ do
|
runPeerM (AnyStorage s) fake p0 $ do
|
||||||
adapter <- mkAdapter cw
|
adapter <- mkAdapter cw
|
||||||
env <- ask
|
env <- ask
|
||||||
|
|
Loading…
Reference in New Issue