mirror of
https://github.com/guzzle/guzzle.git
synced 2025-07-01 13:22:46 +02:00
Fix sleep calculation when waiting for delayed requests
`$nextTime` is always set in the future, and `usleep()` takes microseconds as an argument. Currently this function always returns 0 if there are no ongoing requests, clogging the CPU in the `while` loop.
This commit is contained in:
@ -192,6 +192,6 @@ class CurlMultiHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return max(0, $currentTime - $nextTime);
|
return max(0, $nextTime - $currentTime) * 1000000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user