mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 23:54:03 +00:00
Add comments [ci skip]
This commit is contained in:
parent
e9786cbfc0
commit
e45984100e
1 changed files with 2 additions and 0 deletions
|
|
@ -71,10 +71,12 @@ class RedisStorageDriver implements StorageDriver
|
|||
return "tenants:{$hash}";
|
||||
}, $uuids);
|
||||
|
||||
// Apparently, the PREFIX is applied to all functions except scan()
|
||||
$redis_prefix = $this->redis->getOption($this->redis->client()::OPT_PREFIX);
|
||||
$hashes = $hashes ?: $this->redis->scan(null, $redis_prefix.'tenants:*');
|
||||
|
||||
return array_map(function ($tenant) use ($redis_prefix) {
|
||||
// Left strip $redis_prefix from $tenant
|
||||
if (substr($tenant, 0, strlen($redis_prefix)) == $redis_prefix) {
|
||||
$tenant = substr($tenant, strlen($redis_prefix));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue