This commit is contained in:
Dmitry Zuikov 2023-01-24 13:32:41 +03:00
parent e63441b289
commit 3d03d1ce0f
1 changed files with 5 additions and 7 deletions

View File

@ -385,10 +385,6 @@ mkAdapter cww = do
. 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 $ "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
&& writtenLast >= ( (mbSize * 2) `div` 3 )
@ -425,11 +426,8 @@ mkAdapter cww = do
-- <+> pretty n
-- <+> pretty (B8.length bs)
-- <+> pretty
-- debug $ "written:" <+> pretty written <+> "/" <+> pretty mbSize
when mbDone $ lift do
deferred (Proxy @(BlockChunks e)) $ do