This commit is contained in:
xl
2024-09-04 10:14:29 +08:00
parent a756532738
commit e1e44da5b2
+2 -10
View File
@@ -8,7 +8,6 @@ use Kiri\Di\Context;
use Kiri\Router\Router;
use Kiri\Server\Events\OnWorkerStart;
use Kiri\Server\Processes\AbstractProcess;
use Swoole\Coroutine;
use Swoole\Event;
use Swoole\Process;
@@ -56,17 +55,10 @@ class HotReload extends AbstractProcess
/**
* @return $this
* @return void
*/
public function onSigterm(): static
public function onSigterm(): void
{
// TODO: Implement onSigterm() method.
if (Context::inCoroutine()) {
Coroutine::create(fn () => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT)));
} else {
\pcntl_signal(SIGTERM, [$this, 'onStop']);
}
return $this;
}