forked from GNUsocial/gnu-social
[CORE][Cache] Allow retrieving multiple keys from a hashmap
This commit is contained in:
parent
587d701d11
commit
e6c0db9ee1
@ -318,10 +318,14 @@ abstract class Cache
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getHashMapKey(string $map_key, string $key, string $pool = 'default')
|
public static function getHashMapKey(string $map_key, string|array $key, string $pool = 'default')
|
||||||
{
|
{
|
||||||
if (isset(self::$redis[$pool])) {
|
if (isset(self::$redis[$pool])) {
|
||||||
|
if (\is_string($key)) {
|
||||||
return self::$redis[$pool]->hget($map_key, $key);
|
return self::$redis[$pool]->hget($map_key, $key);
|
||||||
|
} else {
|
||||||
|
return self::$redis[$pool]->hmget($map_key, $key);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new NotImplementedException;
|
throw new NotImplementedException;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user