minor speedup

This commit is contained in:
Dmitry Zuikov 2023-04-26 08:49:56 +03:00
parent f9c70b985d
commit e1cea76d27
1 changed files with 5 additions and 4 deletions

View File

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