From d34868b67ada2a56ff98f2ac2dd49250258d003d Mon Sep 17 00:00:00 2001 From: sji Date: Fri, 5 Jun 2020 22:34:48 +0900 Subject: [PATCH] change the default setting to retry infinitely on read errors --- src/Command/Inspector/Settings/LoopSettings.php | 2 +- src/Lib/Loop/LoopProcess/RetryOnExceptionLoop.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Command/Inspector/Settings/LoopSettings.php b/src/Command/Inspector/Settings/LoopSettings.php index 059306a9..9b763c0c 100644 --- a/src/Command/Inspector/Settings/LoopSettings.php +++ b/src/Command/Inspector/Settings/LoopSettings.php @@ -20,7 +20,7 @@ class LoopSettings { private const SLEEP_NANO_SECONDS_DEFAULT = 1000 * 1000 * 10; private const CANCEL_KEY_DEFAULT = 'q'; - private const MAX_RETRY_DEFAULT = 10; + private const MAX_RETRY_DEFAULT = -1; public int $sleep_nano_seconds; public string $cancel_key; diff --git a/src/Lib/Loop/LoopProcess/RetryOnExceptionLoop.php b/src/Lib/Loop/LoopProcess/RetryOnExceptionLoop.php index 3ab0be59..a03040e4 100644 --- a/src/Lib/Loop/LoopProcess/RetryOnExceptionLoop.php +++ b/src/Lib/Loop/LoopProcess/RetryOnExceptionLoop.php @@ -39,7 +39,7 @@ public function __construct(int $max_retry, array $exception_names, LoopProcessI public function invoke(): bool { - while ($this->current_retry_count <= $this->max_retry) { + while ($this->current_retry_count <= $this->max_retry or $this->max_retry === -1) { try { $result = $this->chain->invoke(); $this->current_retry_count = 0;