File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
src/Connector/FetchExceptionHandler Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1212 "php" : " ^5.5|^7" ,
1313 "scriptfusion/static-class" : " ^1" ,
1414 "scriptfusion/retry" : " ^1.1" ,
15- "scriptfusion/retry-exception-handlers" : " ^1" ,
15+ "scriptfusion/retry-exception-handlers" : " ^1.1 " ,
1616 "psr/container" : " ^1" ,
1717 "psr/cache" : " ^1"
1818 },
Original file line number Diff line number Diff line change 88 */
99class ExponentialSleepFetchExceptionHandler implements FetchExceptionHandler
1010{
11+ private $ initialDelay ;
12+
1113 private $ handler ;
1214
15+ /**
16+ * Initializes this instance with the specified initial delay. The initial delay will be used when the first
17+ * exception is handled; subsequent exceptions will cause longer delays.
18+ *
19+ * @param int $initialDelay Initial delay.
20+ */
21+ public function __construct ($ initialDelay = ExponentialBackoffExceptionHandler::DEFAULT_COEFFICIENT )
22+ {
23+ $ this ->initialDelay = $ initialDelay | 0 ;
24+ }
25+
1326 public function initialize ()
1427 {
15- $ this ->handler = new ExponentialBackoffExceptionHandler ;
28+ $ this ->handler = new ExponentialBackoffExceptionHandler ( $ this -> initialDelay ) ;
1629 }
1730
1831 public function __invoke (\Exception $ exception )
You can’t perform that action at this time.
0 commit comments