mirror of https://github.com/voidlizard/hbs2
wip, export checkpoints
This commit is contained in:
parent
be512971d6
commit
2349ec4157
|
@ -17,6 +17,7 @@ import Data.Heap (Entry(..))
|
||||||
import Data.Heap qualified as Heap
|
import Data.Heap qualified as Heap
|
||||||
import Data.ByteString.Lazy qualified as LBS
|
import Data.ByteString.Lazy qualified as LBS
|
||||||
import Data.Fixed
|
import Data.Fixed
|
||||||
|
import Data.Either
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.HashMap.Strict (HashMap)
|
import Data.HashMap.Strict (HashMap)
|
||||||
import Data.HashMap.Strict qualified as HM
|
import Data.HashMap.Strict qualified as HM
|
||||||
|
@ -340,8 +341,12 @@ updateReflogIndex = do
|
||||||
lbs <- liftIO (runExceptT (getTreeContents sto href))
|
lbs <- liftIO (runExceptT (getTreeContents sto href))
|
||||||
>>= orThrow MissedBlockError
|
>>= orThrow MissedBlockError
|
||||||
|
|
||||||
pieces <- S.toList_ do
|
-- ignoring broken txs
|
||||||
void $ runConsumeLBS (ZstdL.decompress lbs) $ readLogFileLBS () $ \o s _ -> do
|
unzstd <- liftIO (try @_ @SomeException (pure $ ZstdL.decompress lbs)
|
||||||
|
<&> fromRight mempty )
|
||||||
|
|
||||||
|
pieces <- S.toList_ $ do
|
||||||
|
void $ runConsumeLBS unzstd $ readLogFileLBS () $ \o _ _ -> do
|
||||||
lift $ S.yield o
|
lift $ S.yield o
|
||||||
|
|
||||||
lift $ S.yield (h, pieces)
|
lift $ S.yield (h, pieces)
|
||||||
|
|
Loading…
Reference in New Issue