Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frameworks/PHP/swoole/swoole-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,17 @@ function set_host_ip()

function put($db)
{
$this->pool->push($db);
$this->pool->enqueue($db);
$this->pool_count++;
}

function get(string $server_type)
{
if ($this->pool_count > 0) {
$this->pool_count--;
return $this->pool->pop();
return $this->pool->dequeue();
}

// No idle connection, time to create a new connection
if ($server_type === 'mysql') {
$db = new Swoole\Coroutine\Mysql;
Expand Down
2 changes: 1 addition & 1 deletion frameworks/PHP/swoole/swoole.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM php:7.2

ENV SWOOLE_VERSION=2.1.3
ENV SWOOLE_VERSION=4.2.9

RUN cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - \
&& cd swoole-src-${SWOOLE_VERSION} \
Expand Down