From ab18588bda73d051dee70a366b00efd1391c6e13 Mon Sep 17 00:00:00 2001 From: "akihito.nakano" Date: Sun, 23 Dec 2018 14:49:18 +0900 Subject: [PATCH] Fix lastFailureKey() --- src/Ganesha/Storage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Ganesha/Storage.php b/src/Ganesha/Storage.php index 27b3a44..d7b9ebd 100644 --- a/src/Ganesha/Storage.php +++ b/src/Ganesha/Storage.php @@ -333,7 +333,12 @@ private function rejectionKey($service) */ private function lastFailureKey($service) { - return $this->prefix($service) . self::KEY_SUFFIX_LAST_FAILURE_TIME; + return $this->supportRollingTimeWindow() + // If the adapter supports RollingTimeWindow use failureKey() instead, + // because Redis doesn't save lastFailureTime. + // @see Ackintosh\Ganesha\Storage\Adapter\Redis#saveLastFailureTime() + ? $this->failureKey($service) + : $this->prefix($service) . self::KEY_SUFFIX_LAST_FAILURE_TIME; } /**