Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testsv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
operating-system: [ubuntu-latest]
operating-system: [ubuntu-22.04]
php-versions: ['8.0', '8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }} quality/tests on ${{ matrix.operating-system }}
env:
Expand Down
16 changes: 9 additions & 7 deletions lib/Phpfastcache/Drivers/Redis/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ protected function driverConnect(): bool
*/
protected function driverReadAllKeys(string $pattern = '*'): iterable
{
$i = -1;
$keys = $this->instance->scan($i, $pattern === '' ? '*' : $pattern, ExtendedCacheItemPoolInterface::MAX_ALL_KEYS_COUNT);
if (is_iterable($keys)) {
return $keys;
} else {
return [];
}
$i = null;
$pattern = $pattern === '' ? '*' : $pattern;
do {
$keys[] = $this->instance->scan($i, $pattern);
if (\count($keys) > ExtendedCacheItemPoolInterface::MAX_ALL_KEYS_COUNT) {
break;
}
} while ($i > 0);
return \array_merge([], ...$keys);
}

/**
Expand Down
26 changes: 12 additions & 14 deletions lib/Phpfastcache/Drivers/Rediscluster/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function getStats(): DriverStatistic
trim(<<<EOF
Redis Cluster version v%s, php-ext v%s with %d master nodes and %d slaves connected are up since %s.
For more information see RawData.
EOF),
EOF
),
implode(', ', array_unique(array_column($infos, 'redis_version'))),
\phpversion("redis"),
count($masters),
Expand Down Expand Up @@ -123,21 +124,18 @@ protected function driverConnect(): bool
*/
protected function driverReadAllKeys(string $pattern = '*'): iterable
{
$keys = [[]];
$result = [[]];
foreach ($this->instance->_masters() as $master) {
$i = -1;
$result = $this->instance->scan(
$i,
$master,
$pattern === '' ? '*' : $pattern,
ExtendedCacheItemPoolInterface::MAX_ALL_KEYS_COUNT
);
if (is_array($result)) {
$keys[] = $result;
}
$i = 0;
$pattern = $pattern === '' ? '*' : $pattern;
do {
$result[] = $this->instance->scan($i, $master, $pattern);
if (\count($result) > ExtendedCacheItemPoolInterface::MAX_ALL_KEYS_COUNT) {
break;
}
} while ($i > 0);
}

return array_unique(array_merge(...$keys));
return array_unique(\array_merge(...$result));
}

/**
Expand Down