mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
redisd handler方法允许指定主从节点
This commit is contained in:
5
library/think/cache/driver/Redisd.php
vendored
5
library/think/cache/driver/Redisd.php
vendored
@@ -196,6 +196,7 @@ class Redisd
|
||||
*
|
||||
* @access public
|
||||
* @param string $name 缓存key
|
||||
* @param bool $master 指定主从节点,可以从主节点获取结果
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($name, $master = false)
|
||||
@@ -301,10 +302,12 @@ class Redisd
|
||||
* 需要先执行 $redis->master() 连接到 DB
|
||||
*
|
||||
* @access public
|
||||
* @param bool $master 指定主从节点,可以从主节点获取结果
|
||||
* @return object
|
||||
*/
|
||||
public function handler()
|
||||
public function handler($master = true)
|
||||
{
|
||||
$this->master($master);
|
||||
return $this->handler;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user