From e1cea76d2771e6766e3a2fc5b79f9bf855478911 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Wed, 26 Apr 2023 08:49:56 +0300 Subject: [PATCH] minor speedup --- hbs2-peer/app/RefLog.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbs2-peer/app/RefLog.hs b/hbs2-peer/app/RefLog.hs index 684f9d2a..97624708 100644 --- a/hbs2-peer/app/RefLog.hs +++ b/hbs2-peer/app/RefLog.hs @@ -227,13 +227,14 @@ reflogWorker conf adapter = do pause (fromIntegral i :: Timeout 'Minutes) - w1 <- liftIO $ async $ forever $ do + w1 <- liftIO $ async $ forever $ replicateConcurrently_ 4 do -- TODO: reflog-process-period-to-config - pause @'Seconds 10 + -- pause @'Seconds 10 + + _ <- liftIO $ atomically $ peekTQueue pQ els <- liftIO $ atomically $ flushTQueue pQ - let byRef = HashMap.fromListWith (<>) els for_ (HashMap.toList byRef) $ \(r,x) -> do @@ -267,7 +268,7 @@ reflogWorker conf adapter = do trace $ "new reflog value" <+> pretty (AsBase58 r) <+> pretty newRoot - trace "I'm a reflog update worker" + -- trace "I'm a reflog update worker" pollers <- liftIO $ wait pollers' void $ liftIO $ waitAnyCatchCancel $ w1 : pollers