From 6d69b40400f81761466cbf14839b55b31e3832b9 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Wed, 6 Nov 2024 15:14:16 +0300 Subject: [PATCH] fix --- hbs2-peer/app/RPC2.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbs2-peer/app/RPC2.hs b/hbs2-peer/app/RPC2.hs index ceeaea25..555b1419 100644 --- a/hbs2-peer/app/RPC2.hs +++ b/hbs2-peer/app/RPC2.hs @@ -267,7 +267,7 @@ runBurstMachine BurstMachine{..} = do new <- if e2 > e1 then do let d = max 2.0 (current * (1.0 - down)) - nrates <- readTVar _rates <&> drop 10 . Map.toList + nrates <- readTVar _rates <&> drop 3 . Map.toList let newFucked = maybe d snd (headMay nrates) writeTVar _rates (Map.fromList nrates) pure newFucked @@ -480,7 +480,7 @@ downloadFromPeer t bu cache env h peer = liftIO $ withPeerM env do let watchdog = fix \next -> do wx <- readTVarIO _wx <&> realToFrac -- debug $ "WATCHDOG" <+> pretty wx <+> pretty waity - r <- race (pause @'MilliSeconds waity) do + r <- race (pause @'MilliSeconds (min wx waity)) do void $ atomically $ readTQueue chuQ either (const none) (const next) r