modify
This commit is contained in:
@@ -174,7 +174,7 @@ abstract class Pool extends Component
|
|||||||
if ($this->_items[$name]->isEmpty()) {
|
if ($this->_items[$name]->isEmpty()) {
|
||||||
$this->createByCallback($name, $callback);
|
$this->createByCallback($name, $callback);
|
||||||
}
|
}
|
||||||
$connection = $this->_items[$name]->pop(0.002);
|
$connection = $this->_items[$name]->pop();
|
||||||
if (!$this->checkCanUse($name, $connection)) {
|
if (!$this->checkCanUse($name, $connection)) {
|
||||||
return $this->createClient($name, $callback);
|
return $this->createClient($name, $callback);
|
||||||
} else {
|
} else {
|
||||||
@@ -297,6 +297,7 @@ abstract class Pool extends Component
|
|||||||
if (!$this->_items[$name]->isFull()) {
|
if (!$this->_items[$name]->isFull()) {
|
||||||
$this->_items[$name]->push($client);
|
$this->_items[$name]->push($client);
|
||||||
}
|
}
|
||||||
|
unset($client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ class Redis extends Pool
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->push($coroutineName, Context::getContext($coroutineName));
|
$this->push($coroutineName, Context::getContext($coroutineName));
|
||||||
|
Context::remove($coroutineName);
|
||||||
$this->lastTime = time();
|
$this->lastTime = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +118,7 @@ class Redis extends Pool
|
|||||||
if (Context::hasContext($coroutineName)) {
|
if (Context::hasContext($coroutineName)) {
|
||||||
$this->decrement($coroutineName);
|
$this->decrement($coroutineName);
|
||||||
}
|
}
|
||||||
|
Context::remove($coroutineName);
|
||||||
$this->flush(0);
|
$this->flush(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user