mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
e63441b289
commit
3d03d1ce0f
|
@ -385,10 +385,6 @@ mkAdapter cww = do
|
||||||
. over sBlockWritten (+ bslen)
|
. over sBlockWritten (+ bslen)
|
||||||
)
|
)
|
||||||
|
|
||||||
-- this is updating concurrently,
|
|
||||||
-- so collect last data from all posible threads
|
|
||||||
writtenLast <- MaybeT $ find cKey (view sBlockWritten)
|
|
||||||
maxOffLast <- MaybeT $ find cKey (view sBlockOffset)
|
|
||||||
|
|
||||||
-- debug $ "gotShit" <+> pretty (B8.length bs) <+> pretty (writtenLast) <+> pretty (wr
|
-- debug $ "gotShit" <+> pretty (B8.length bs) <+> pretty (writtenLast) <+> pretty (wr
|
||||||
-- debug $ "writtenLast" <+> pretty writtenLast
|
-- debug $ "writtenLast" <+> pretty writtenLast
|
||||||
|
@ -417,6 +413,11 @@ mkAdapter cww = do
|
||||||
-- Монитор может быть протухающим.
|
-- Монитор может быть протухающим.
|
||||||
-- Как это сделать?
|
-- Как это сделать?
|
||||||
|
|
||||||
|
-- this is updating concurrently,
|
||||||
|
-- so collect last data from all posible threads
|
||||||
|
writtenLast <- MaybeT $ find cKey (view sBlockWritten)
|
||||||
|
maxOffLast <- MaybeT $ find cKey (view sBlockOffset)
|
||||||
|
|
||||||
let mbDone = (maxOffLast + fromIntegral mbChSize) > fromIntegral mbSize
|
let mbDone = (maxOffLast + fromIntegral mbChSize) > fromIntegral mbSize
|
||||||
&& writtenLast >= ( (mbSize * 2) `div` 3 )
|
&& writtenLast >= ( (mbSize * 2) `div` 3 )
|
||||||
|
|
||||||
|
@ -425,11 +426,8 @@ mkAdapter cww = do
|
||||||
-- <+> pretty n
|
-- <+> pretty n
|
||||||
-- <+> pretty (B8.length bs)
|
-- <+> pretty (B8.length bs)
|
||||||
-- <+> pretty
|
-- <+> pretty
|
||||||
|
|
||||||
|
|
||||||
-- debug $ "written:" <+> pretty written <+> "/" <+> pretty mbSize
|
-- debug $ "written:" <+> pretty written <+> "/" <+> pretty mbSize
|
||||||
|
|
||||||
|
|
||||||
when mbDone $ lift do
|
when mbDone $ lift do
|
||||||
|
|
||||||
deferred (Proxy @(BlockChunks e)) $ do
|
deferred (Proxy @(BlockChunks e)) $ do
|
||||||
|
|
Loading…
Reference in New Issue