1.0.14 hotfix

This commit is contained in:
Pinga 2025-02-11 17:14:03 +02:00
parent 181e3738a7
commit ddfb8fed75
5 changed files with 144 additions and 4 deletions

View file

@ -12,7 +12,6 @@ declare(strict_types=1);
use Swoole\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Coroutine\Redis;
require __DIR__ . '/vendor/autoload.php';
@ -39,7 +38,7 @@ class RedisPool {
public function initialize(int $size = 10): void {
for ($i = 0; $i < $size; $i++) {
// Create a coroutine for each connection.
Swoole\Coroutine::create(function () {
Swoole\Coroutine\run(function () {
$redis = new Redis();
if (!$redis->connect($this->host, $this->port)) {
throw new Exception("Failed to connect to Redis at {$this->host}:{$this->port}");