From 3274a38c9b672aaa3f5105995d60009c87e66fde Mon Sep 17 00:00:00 2001 From: Fabian Gruber Date: Mon, 19 May 2025 12:40:11 +0200 Subject: [PATCH] fix: task coroutine hooks --- app/cli.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/cli.php b/app/cli.php index 0f0e48bf7d..a1e41289b2 100644 --- a/app/cli.php +++ b/app/cli.php @@ -10,6 +10,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Platform\Appwrite; use Appwrite\Runtimes\Runtimes; use Executor\Executor; +use Swoole\Runtime; use Swoole\Timer; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; @@ -298,4 +299,6 @@ $cli $cli->shutdown()->action(fn () => Timer::clearAll()); +// Enable coroutines, but disable TCP hooks. These don't work until we use `\Utopia\Cache\Adapter\Pool` and `\Utopia\Database\Adapter\Pool`. +Runtime::enableCoroutine(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP); run($cli->run(...));