-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DbConnection::check时,验证闲置时间是否超过最大值 (swoft-cloud/swoft-component#189)
* 验证空闲时间是否超过最大值 * 验证空闲时间是否超过最大值 * 验证空闲时间是否超过最大值 * 完善对应单测 * 抽离验证空闲时间是否超过最大值的逻辑 * 代码格式化 * 抽离验证空闲时间是否超过最大值的逻辑 * Update AbstractDbConnection.php
- Loading branch information
1 parent
805ab2c
commit ef53911
Showing
6 changed files
with
112 additions
and
0 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
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,33 @@ | ||
<?php | ||
/** | ||
* This file is part of Swoft. | ||
* | ||
* @link https://swoft.org | ||
* @document https://doc.swoft.org | ||
* @contact [email protected] | ||
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE | ||
*/ | ||
namespace SwoftTest\Db\Testing\Pool; | ||
|
||
use Swoft\Bean\Annotation\Bean; | ||
use Swoft\Bean\Annotation\Value; | ||
use Swoft\Db\Driver\Driver; | ||
use Swoft\Db\Pool\Config\DbPoolProperties; | ||
|
||
/** | ||
* OtherDbConfig | ||
* | ||
* @Bean() | ||
*/ | ||
class MaxIdleTimeDbConfig extends OtherDbConfig | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $name = 'idle.master'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $maxIdleTime = 1; | ||
} |
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,28 @@ | ||
<?php | ||
/** | ||
* This file is part of Swoft. | ||
* | ||
* @link https://swoft.org | ||
* @document https://doc.swoft.org | ||
* @contact [email protected] | ||
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE | ||
*/ | ||
namespace SwoftTest\Db\Testing\Pool; | ||
|
||
use Swoft\Bean\Annotation\Inject; | ||
use Swoft\Bean\Annotation\Pool; | ||
use Swoft\Db\Pool\DbPool; | ||
|
||
/** | ||
* OtherDbPool | ||
* | ||
* @Pool("idle.master") | ||
*/ | ||
class MaxIdleTimeDbPool extends DbPool | ||
{ | ||
/** | ||
* @Inject() | ||
* @var MaxIdleTimeDbConfig | ||
*/ | ||
protected $poolConfig; | ||
} |