mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
06f46c768a
commit
6fd1d2479a
|
@ -183,15 +183,20 @@ scanGitLogLocal refMask play = do
|
||||||
withState $ transactional do
|
withState $ transactional do
|
||||||
|
|
||||||
flip runContT pure do
|
flip runContT pure do
|
||||||
for_ logz $ \(commitHash, h) -> do
|
for_ logz $ \(commitHash, h) -> callCC \shit -> do
|
||||||
warn $ blue "SCAN BLOB" <+> pretty h
|
warn $ blue "SCAN BLOB" <+> pretty h
|
||||||
tmp <- ContT $ bracket (liftIO (emptySystemTempFile "fixme-log")) rm
|
tmp <- ContT $ bracket (liftIO (emptySystemTempFile "fixme-log")) rm
|
||||||
blob <- lift $ lift $ gitCatBlob h
|
blob <- lift $ lift $ gitCatBlob h
|
||||||
liftIO (LBS8.writeFile tmp blob)
|
liftIO (LBS8.writeFile tmp blob)
|
||||||
sto <- ContT $ bracket (compactStorageOpen @HbSync readonly tmp) compactStorageClose
|
|
||||||
|
esto <- lift $ try @_ @CompactStorageOpenError $ compactStorageOpen @HbSync readonly tmp
|
||||||
|
either (const $ warn $ "skip malformed/unknown log" <+> pretty h) (const none) esto
|
||||||
|
sto <- either (const $ shit ()) pure esto
|
||||||
|
|
||||||
lift $ lift $ loadAllEntriesFromLog sto >>= play
|
lift $ lift $ loadAllEntriesFromLog sto >>= play
|
||||||
lift $ insertProcessed (ViaSerialise commitHash)
|
lift $ insertProcessed (ViaSerialise commitHash)
|
||||||
|
|
||||||
|
compactStorageClose sto
|
||||||
|
|
||||||
scanGitLocal :: FixmePerks m
|
scanGitLocal :: FixmePerks m
|
||||||
=> [ScanGitArgs]
|
=> [ScanGitArgs]
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{-# Language UndecidableInstances #-}
|
{-# Language UndecidableInstances #-}
|
||||||
module HBS2.Storage.Compact
|
module HBS2.Storage.Compact
|
||||||
( Storage(..)
|
( Storage(..)
|
||||||
|
, CompactStorageOpenError(..)
|
||||||
, CompactStorage
|
, CompactStorage
|
||||||
, CompactStorageOpenOpt(..)
|
, CompactStorageOpenOpt(..)
|
||||||
, readonly
|
, readonly
|
||||||
|
|
Loading…
Reference in New Issue