Skip to content

Commit

Permalink
Merge pull request #14 from boesing/bugfix/maximum-key-length
Browse files Browse the repository at this point in the history
bugfix: ensure maximum key length reflects redis documentation
  • Loading branch information
boesing authored Jun 3, 2021
2 parents f871faa + 66ead6b commit 0893a40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ protected function internalGetCapabilities()
$serializer = $resourceMgr->getLibOption($options->getResourceId(), RedisResource::OPT_SERIALIZER);
$redisVersion = $resourceMgr->getMajorVersion($options->getResourceId());
$minTtl = version_compare($redisVersion, '2', '<') ? 0 : 1;
$maxKeyLength = version_compare($redisVersion, '3', '<') ? 255 : 512000000;
$supportedMetadata = $redisVersion >= 2 ? ['ttl'] : [];

$this->capabilities = new Capabilities(
Expand Down Expand Up @@ -533,7 +534,7 @@ protected function internalGetCapabilities()
'staticTtl' => true,
'ttlPrecision' => 1,
'useRequestTime' => false,
'maxKeyLength' => 255,
'maxKeyLength' => $maxKeyLength,
'namespaceIsPrefix' => true,
]
);
Expand Down

0 comments on commit 0893a40

Please sign in to comment.