Skip to content

Commit

Permalink
Fix lastFailureKey()
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Dec 23, 2018
1 parent 5104939 commit ab18588
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Ganesha/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit ab18588

Please sign in to comment.