From 50c8c644ff06802d9c2d13539b8b63095111e24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 2 Jul 2019 17:57:08 +0800 Subject: [PATCH] Format code. --- src/redis/src/RedisConnection.php | 3 ++- src/redis/tests/RedisTest.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redis/src/RedisConnection.php b/src/redis/src/RedisConnection.php index 659608de6..425587fee 100644 --- a/src/redis/src/RedisConnection.php +++ b/src/redis/src/RedisConnection.php @@ -85,7 +85,7 @@ class RedisConnection extends BaseConnection implements ConnectionInterface $this->connection = $redis; $this->lastUseTime = microtime(true); $this->setDbChanged(false); - + return true; } @@ -99,6 +99,7 @@ class RedisConnection extends BaseConnection implements ConnectionInterface if ($this->dbChanged) { // Select the origin db after execute select. $this->select($this->config['db'] ?? 0); + $this->setDbChanged(false); } parent::release(); } diff --git a/src/redis/tests/RedisTest.php b/src/redis/tests/RedisTest.php index cdbabc244..3ae47c0a6 100644 --- a/src/redis/tests/RedisTest.php +++ b/src/redis/tests/RedisTest.php @@ -19,7 +19,6 @@ use Hyperf\Redis\Pool\PoolFactory; use Hyperf\Redis\Pool\RedisPool; use Hyperf\Redis\Redis; use Hyperf\Utils\ApplicationContext; -use Hyperf\Utils\Context; use HyperfTest\Redis\Stub\RedisPoolStub; use Mockery; use PHPUnit\Framework\TestCase;