From 210821bdf92b42ba76a7eed72d8eab508ffc9302 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 6 Apr 2026 09:15:30 +0530 Subject: [PATCH] Fix coroutine server shutdown deprecation --- .../Utopia/Http/Adapter/SwooleCoroutine/Server.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Utopia/Http/Adapter/SwooleCoroutine/Server.php b/src/Appwrite/Utopia/Http/Adapter/SwooleCoroutine/Server.php index d4d0f98411..0f732f6814 100644 --- a/src/Appwrite/Utopia/Http/Adapter/SwooleCoroutine/Server.php +++ b/src/Appwrite/Utopia/Http/Adapter/SwooleCoroutine/Server.php @@ -85,7 +85,7 @@ class Server extends Adapter public function start() { - go(function () { + $startServer = function (): void { $this->initializeRequestSemaphore(); if ($this->onStartCallback) { @@ -93,7 +93,15 @@ class Server extends Adapter } $this->server->start(); - }); + }; + + if (Coroutine::getCid() !== -1) { + $startServer(); + + return; + } + + \Swoole\Coroutine\run($startServer); } private function initializeRequestSemaphore(): void