This commit is contained in:
voidlizard 2024-11-14 09:29:50 +03:00
parent 1e9aadfab5
commit fd7a394779
1 changed files with 24 additions and 19 deletions

View File

@ -694,8 +694,8 @@ downloadDispatcher brains env = flip runContT pure do
bm <- liftIO do
case _sockType p of
TCP -> newBurstMachine 10 256 (Just 256) 0.25 0.45
UDP -> newBurstMachine 10 256 (Just 50) 0.10 0.25
TCP -> newBurstMachine 20 256 (Just 256) 0.25 0.45
UDP -> newBurstMachine 3 256 (Just 50) 0.10 0.25
void $ ContT $ bracket none $ const do
debug $ "Cancelling thread for" <+> pretty p
@ -744,6 +744,11 @@ downloadDispatcher brains env = flip runContT pure do
PChoose -> do
what <- atomically do
e <- readTVar _errors
if e > 10 then
pure Nothing
else do
TSem.waitTSem sem
wpsize <- readTVar wip <&> HM.size
@ -775,7 +780,7 @@ downloadDispatcher brains env = flip runContT pure do
if erno > 50 then do
pause @'Seconds 60
else do
pause @'Seconds 0.25
pause @'Seconds 1.00
go PChoose
PInit hx dcb -> do