Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yf committed Nov 28, 2018
1 parent 00db449 commit 38fb502
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Pool/AbstractPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ public function gcObject(int $idleTime)
while (true){
if(!$this->chan->isEmpty()){
$obj = $this->chan->pop(0.001);
if(time() - $obj->last_recycle_time > $idleTime){
$this->unsetObj($obj);
}else{
array_push($list,$obj);
if(is_object($obj)){
if(time() - $obj->last_recycle_time > $idleTime){
$this->unsetObj($obj);
}else{
array_push($list,$obj);
}
}
}else{
break;
Expand Down

0 comments on commit 38fb502

Please sign in to comment.