From af613784fd8e08c2740d2d8a69f526ed26cc8011 Mon Sep 17 00:00:00 2001 From: xl Date: Tue, 3 Sep 2024 14:47:29 +0800 Subject: [PATCH] eee --- RpcProcess.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RpcProcess.php b/RpcProcess.php index 933d718..6975911 100644 --- a/RpcProcess.php +++ b/RpcProcess.php @@ -3,9 +3,10 @@ namespace Kiri\Rpc; use Kiri\Di\Context; -use Kiri\Server\Abstracts\BaseProcess; +use Kiri\Server\Processes\BaseProcess; use Swoole\Coroutine; use Swoole\Process; +use function pcntl_signal; class RpcProcess extends BaseProcess { @@ -39,8 +40,8 @@ class RpcProcess extends BaseProcess if (Context::inCoroutine()) { Coroutine::create(fn() => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT))); } else { - \pcntl_signal(SIGTERM, [$this, 'onStop']); - \pcntl_signal(SIGINT, [$this, 'onStop']); + pcntl_signal(SIGTERM, [$this, 'onStop']); + pcntl_signal(SIGINT, [$this, 'onStop']); } return $this; }