Skip to content

Commit

Permalink
[Cache] Fixed not supported Redis eviction policies
Browse files Browse the repository at this point in the history
  • Loading branch information
SerheyDolgushev committed Apr 28, 2020
1 parent 1bc3ee7 commit 3d6e942
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php
Expand Up @@ -14,8 +14,8 @@
use Predis\Connection\Aggregate\ClusterInterface;
use Predis\Connection\Aggregate\PredisCluster;
use Predis\Response\Status;
use Symfony\Component\Cache\CacheItem;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
use Symfony\Component\Cache\Exception\LogicException;
use Symfony\Component\Cache\Marshaller\DeflateMarshaller;
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
use Symfony\Component\Cache\Marshaller\TagAwareMarshaller;
Expand Down Expand Up @@ -95,9 +95,7 @@ protected function doSave(array $values, ?int $lifetime, array $addTagData = [],
{
$eviction = $this->getRedisEvictionPolicy();
if ('noeviction' !== $eviction && 0 !== strpos($eviction, 'volatile-')) {
CacheItem::log($this->logger, sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies', $eviction));

return false;
throw new LogicException(sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies.', $eviction));
}

// serialize values
Expand Down

0 comments on commit 3d6e942

Please sign in to comment.