mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +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
|
* @access public
|
||||||
* @param string $name 缓存key
|
* @param string $name 缓存key
|
||||||
|
* @param bool $master 指定主从节点,可以从主节点获取结果
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function get($name, $master = false)
|
public function get($name, $master = false)
|
||||||
@@ -301,10 +302,12 @@ class Redisd
|
|||||||
* 需要先执行 $redis->master() 连接到 DB
|
* 需要先执行 $redis->master() 连接到 DB
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param bool $master 指定主从节点,可以从主节点获取结果
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
public function handler()
|
public function handler($master = true)
|
||||||
{
|
{
|
||||||
|
$this->master($master);
|
||||||
return $this->handler;
|
return $this->handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user