1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 17:04:03 +00:00

Fix Redis scan

This commit is contained in:
Samuel Štancl 2019-08-15 20:27:20 +02:00
parent 674f4b3f9a
commit 8eb380df58

View file

@ -88,11 +88,10 @@ class RedisStorageDriver implements StorageDriver
if (config('database.redis.client') === 'phpredis') {
$redis_prefix = $this->redis->getOption($this->redis->client()::OPT_PREFIX) ?? $redis_prefix;
$all_keys = $this->redis->scan(null, $redis_prefix . 'tenants:*');
} else {
$all_keys = $this->redis->scan(null, 'MATCH', $redis_prefix . 'tenants:*')[1];
}
$all_keys = $this->redis->keys($redis_prefix . 'tenants:*');
$hashes = array_map(function ($key) use ($redis_prefix) {
// Left strip $redis_prefix from $key
return substr($key, strlen($redis_prefix));