Skip to content

Commit 5c58e4f

Browse files
committed
update retry plugin backoff default to be more sensible
1 parent 600ea9a commit 5c58e4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Plugin/RetryPlugin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class RetryPlugin implements Plugin
4646
*
4747
* @var int $retries Number of retries to attempt if an exception occurs before letting the exception bubble up.
4848
* @var callable $decider A callback that gets a request and an exception to decide after a failure whether the request should be retried.
49-
* @var callable $delay A callback that gets a request, an exception and the number of retries and returns how many milliseconds we should wait before trying again.
49+
* @var callable $delay A callback that gets a request, an exception and the number of retries and returns how many microseconds we should wait before trying again.
5050
* }
5151
*/
5252
public function __construct(array $config = [])
@@ -117,6 +117,6 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
117117
*/
118118
public static function defaultDelay(RequestInterface $request, Exception $e, $retries)
119119
{
120-
return pow(2, $retries) * 1000;
120+
return pow(2, $retries) * 1000 * 500;
121121
}
122122
}

0 commit comments

Comments
 (0)