wip, log merging, debug-11

This commit is contained in:
Dmitry Zuikov 2023-07-19 13:23:11 +03:00
parent 0e1bf90928
commit 5b601c5daf
1 changed files with 6 additions and 5 deletions

View File

@ -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)