diff --git a/Etcd.php b/Etcd.php index 552a352..6a8faaa 100644 --- a/Etcd.php +++ b/Etcd.php @@ -38,7 +38,7 @@ class Etcd extends Component } $key = 'center.service.' . gethostbyname(gethostname()); - pcntl_signal(SIGINT, function () use ($key) { + \pcntl_signal(SIGINT, function () use ($key) { $this->isEnd = true; $this->client->del($key); }); diff --git a/RpcProcess.php b/RpcProcess.php index 7726aa5..933d718 100644 --- a/RpcProcess.php +++ b/RpcProcess.php @@ -39,8 +39,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; }