From cb7f4e8d57829f0405be9f18cfccf4a23c21b0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=98=E7=BC=98?= Date: Sun, 8 May 2016 23:29:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84redisd=20ma?= =?UTF-8?q?ster=20=E8=BF=94=E5=9B=9E=E7=9A=84=E9=94=99=E8=AF=AF=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/cache/driver/Redisd.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/think/cache/driver/Redisd.php b/library/think/cache/driver/Redisd.php index dbfdafad..426f594e 100644 --- a/library/think/cache/driver/Redisd.php +++ b/library/think/cache/driver/Redisd.php @@ -111,7 +111,8 @@ class Redisd public function master($master = false) { if (isset(self::$redis_rw_handler[$master])) { - return $this->handler = self::$redis_rw_handler[$master]; + $this->handler = self::$redis_rw_handler[$master]; + return $this; } //如果不为主,则从配置的host剔除主,并随机读从,失败以后再随机选择从 @@ -186,7 +187,8 @@ class Redisd throw new Exception($e->getMessage(), $e->getCode()); } - return self::$redis_rw_handler[$master] = $this->handler; + self::$redis_rw_handler[$master] = $this->handler; + return $this; } /**