From c7c323ca9e983c94c663a6661eae5f068b9e7bc2 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Sat, 7 Dec 2024 14:45:58 +0300 Subject: [PATCH] wip35 --- hbs2-git3/app/Main.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hbs2-git3/app/Main.hs b/hbs2-git3/app/Main.hs index c6aeaee8..d4b26739 100644 --- a/hbs2-git3/app/Main.hs +++ b/hbs2-git3/app/Main.hs @@ -1259,10 +1259,11 @@ theDict = do debug $ "WHATEVER" <+> pretty e <+> pretty cb <+> pretty co pure $ not e - traverseToCBlock sto cb whatever $ \i h hs -> do - debug $ green "process cblock data" <+> pretty i <+> pretty h + traverseToCBlock sto cb whatever $ \i theCblk hs -> do + debug $ green "process cblock data" <+> pretty i <+> pretty theCblk _orphans <- newTVarIO ( mempty :: HashSet GitHash ) + _cblocks <- newTQueueIO for_ hs $ \hx -> do @@ -1289,6 +1290,9 @@ theDict = do let contents = Zlib.compressWith params (signature <> body) LBS.hPutStr fh contents + when (t == Commit) do + atomically $ writeTQueue _cblocks (theCblk, h) + pure True IOp _ _ (ISetRef ref w h ) -> do @@ -1316,6 +1320,11 @@ theDict = do UIO.writeBinaryFileAtomic shallowFile current + withState $ transactional do + cbs <- atomically $ STM.flushTQueue _cblocks + for_ cbs $ \(cbh, commit) -> do + insertCBlock commit cbh + entry $ bindMatch "test:git:cblock:size:deep" $ nil_ $ \case [ HashLike cblock ] -> lift do