mirror of https://github.com/voidlizard/hbs2
block upload degradation fix?
This commit is contained in:
parent
596d8f1e16
commit
0182c75144
|
@ -830,9 +830,9 @@ runPeer opts = respawnOnError opts $ do
|
||||||
simpleStorageSetProbe s stoProbe
|
simpleStorageSetProbe s stoProbe
|
||||||
addProbe stoProbe
|
addProbe stoProbe
|
||||||
|
|
||||||
stn <- getNumCapabilities -- <&> max 2 . div 2
|
stn <- getNumCapabilities <&> max 2 . div 1
|
||||||
|
|
||||||
w <- replicateM stn $ async $ liftIO $ simpleStorageWorker s
|
w <- replicateM stn $ asyncBound $ liftIO $ simpleStorageWorker s
|
||||||
|
|
||||||
localMulticast <- liftIO $ (headMay <$> parseAddrUDP (fromString defLocalMulticast)
|
localMulticast <- liftIO $ (headMay <$> parseAddrUDP (fromString defLocalMulticast)
|
||||||
<&> fmap (fromSockAddr @'UDP . addrAddress) )
|
<&> fmap (fromSockAddr @'UDP . addrAddress) )
|
||||||
|
|
|
@ -99,12 +99,12 @@ blockChunksProto adapter (BlockChunks c p) = do
|
||||||
|
|
||||||
bsz' <- blkSize adapter h
|
bsz' <- blkSize adapter h
|
||||||
|
|
||||||
maybe1 bsz' (pure ()) $ \bsz -> deferred @proto do
|
maybe1 bsz' (pure ()) $ \bsz -> do
|
||||||
|
|
||||||
let offsets' = calcChunks bsz (fromIntegral size) :: [(Offset, Size)]
|
let offsets' = calcChunks bsz (fromIntegral size) :: [(Offset, Size)]
|
||||||
let offsets = take (fromIntegral num) $ drop (fromIntegral n1) $ zip offsets' [0..]
|
let offsets = take (fromIntegral num) $ drop (fromIntegral n1) $ 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
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ blockChunksProto adapter (BlockChunks c p) = do
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue