This commit is contained in:
2023-03-31 10:24:29 +08:00
parent 5c861c312b
commit 71eb325e80
+4
View File
@@ -14,6 +14,7 @@ use Psr\Log\LoggerInterface;
use ReflectionException;
use Kiri\Server\Config as SConfig;
use Kiri\Di\LocalService;
use Swoole\Runtime;
use Swoole\Server;
use Kiri\Server\ServerInterface;
use Kiri\Server\Constant;
@@ -143,6 +144,9 @@ class AsyncServer implements ServerInterface
$settings[Constant::OPTION_DAEMONIZE] = (bool)$daemon;
$settings[Constant::OPTION_ENABLE_REUSE_PORT] = true;
$settings[Constant::OPTION_PID_FILE] = storage('.swoole.pid');
if ($settings[Constant::OPTION_ENABLE_COROUTINE] ?? false) {
Runtime::enableCoroutine();
}
if (!isset($settings[Constant::OPTION_PID_FILE])) {
$settings[Constant::OPTION_LOG_FILE] = storage('system.log');
}