Fix coroutine check in Client class to handle negative CIDs correctly

This commit is contained in:
shimon committed 2025-07-30 15:11:56 +03:00
1 parent da2237950b
commit cf12c216dc
1 file changed
+1 -3
+1 -3
View File
@@ -9,8 +9,6 @@ use Swoole\Coroutine\Client as CoroutineClient;
use stdClass;
use Swoole\Coroutine;
class Client
{
/**
@@ -92,7 +90,7 @@ class Client
if ($useCoroutine) {
try {
$cid = \Swoole\Coroutine::getCid();
if ($cid === false || $cid === 0) {
if ($cid === false || $cid < 0) {
$useCoroutine = false;
}
} catch (\Throwable $e) {