This commit is contained in:
2021-03-01 15:09:36 +08:00
parent 08b21aeb7b
commit 62e2153446
2 changed files with 425 additions and 416 deletions
+8 -2
View File
@@ -7,8 +7,10 @@ namespace HttpServer;
use Exception;
use JetBrains\PhpStorm\Pure;
use Snowflake\Abstracts\Config;
use Snowflake\Abstracts\Input;
use Snowflake\Exception\ComponentException;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Swoole\WebSocket\Server;
@@ -63,11 +65,15 @@ trait Action
/**
* @return mixed
* @throws ComponentException
* @throws ConfigException
*/
private function getPidFile(): string
{
return Snowflake::app()->getSwoole()->setting['pid_file'];
$settings = Config::get('settings', false, []);
if (!isset($settings['pid_file'])) {
return PID_PATH;
}
return $settings['pid_file'];
}