This commit is contained in:
2021-11-04 16:45:40 +08:00
parent 92a35d8e4f
commit a7024843d3
@@ -7,6 +7,7 @@ use Kiri\Abstracts\Config;
use Kiri\Abstracts\Logger;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
use Swoole\Coroutine;
use Swoole\Coroutine\Barrier;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -62,6 +63,12 @@ class FileChangeCustomProcess extends Command
go(function () {
$this->trigger_reload();
});
go(function () {
$sign = Coroutine::waitSignal(SIGTERM, -1);
if ($sign) {
proc_open("php " . APP_PATH . "kiri.php sw:server stop", [], $pipes);
}
});
go(function () use ($driver) {
$driver->start();
});