Skip to content

Commit 2a73861

Browse files
[8.x] Explicitly set unit of sleep of retry function (#36810)
* Explicitly set unit of sleep or retry functon * Update helpers.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent a274fc7 commit 2a73861

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Illuminate/Support/helpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ function preg_replace_array($pattern, array $replacements, $subject)
216216
*
217217
* @param int $times
218218
* @param callable $callback
219-
* @param int $sleep
219+
* @param int $sleepMilliseconds
220220
* @param callable|null $when
221221
* @return mixed
222222
*
223223
* @throws \Exception
224224
*/
225-
function retry($times, callable $callback, $sleep = 0, $when = null)
225+
function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null)
226226
{
227227
$attempts = 0;
228228

@@ -237,8 +237,8 @@ function retry($times, callable $callback, $sleep = 0, $when = null)
237237
throw $e;
238238
}
239239

240-
if ($sleep) {
241-
usleep($sleep * 1000);
240+
if ($sleepMilliseconds) {
241+
usleep($sleepMilliseconds * 1000);
242242
}
243243

244244
goto beginning;

0 commit comments

Comments
 (0)