This commit is contained in:
2024-04-24 14:31:06 +08:00
parent a761bb3428
commit 6418b3288b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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);
});
+2 -2
View File
@@ -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;
}