-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ywisax
committed
Dec 6, 2016
1 parent
4dd6bca
commit ca44d79
Showing
4 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace tourze\workerman\yii2\redis; | ||
|
||
class Connection extends \yii\redis\Connection | ||
{ | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function open() | ||
{ | ||
// 链接还生效的话,就不重连了 | ||
if ($this->getIsActive()) | ||
{ | ||
return; | ||
} | ||
parent::open(); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function close() | ||
{ | ||
// 不主动关闭redis连接 | ||
} | ||
|
||
/** | ||
* 真实关闭链接 | ||
*/ | ||
public function realClose() | ||
{ | ||
parent::close(); | ||
} | ||
} |