From 5b601c5daff749681f5c4894e00cae45b884d280 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Wed, 19 Jul 2023 13:23:11 +0300 Subject: [PATCH] wip, log merging, debug-11 --- hbs2-peer/app/RefChan.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hbs2-peer/app/RefChan.hs b/hbs2-peer/app/RefChan.hs index 83946903..0d6849a1 100644 --- a/hbs2-peer/app/RefChan.hs +++ b/hbs2-peer/app/RefChan.hs @@ -192,13 +192,13 @@ refChanWorker env brains = do h <- liftIO $ getRef sto (RefChanLogKey @s chan) -- игнорируем, если синхронно - unless ((HashRef <$> h) == Just val) do + -- unless ((HashRef <$> h) == Just val) do - refChanAddDownload env chan val $ \href -> do - debug $ "BLOCK DOWNLOADED" <+> pretty href - atomically $ writeTQueue mergeQ (chan, href) + refChanAddDownload env chan val $ \href -> do + debug $ "BLOCK DOWNLOADED" <+> pretty href + atomically $ writeTQueue mergeQ (chan, href) - atomically $ writeTQueue mergeQ (chan, val) + atomically $ writeTQueue mergeQ (chan, val) forever do pause @'Seconds 10 @@ -443,6 +443,7 @@ logMergeProcess _ q = do current <- lift $ readLog sto (HashRef h) <&> HashSet.fromList trans <- filter (not . flip HashSet.member current) . mconcat <$> mapM (lift . readLog sto) logs + -- trans <- mconcat <$> mapM (lift . readLog sto) logs guard (not $ List.null trans)