This commit is contained in:
2020-09-07 18:35:56 +08:00
parent 957f54a608
commit 01415cf6a2
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -5,6 +5,8 @@ namespace HttpServer;
use Exception;
use Snowflake\Abstracts\Input;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
use Swoole\WebSocket\Server;
@@ -28,7 +30,6 @@ trait Action
}
/**
* @param \HttpServer\Server $socket
* @throws Exception
@@ -97,9 +98,15 @@ trait Action
/**
* @param $port
* @return bool|array
* @throws ComponentException
*/
private function isUse($port)
{
/** @var Input $input */
$input = Snowflake::app()->get('input');
if (in_array($input->get('action'), ['start', 'restart'])) {
return true;
}
if (empty($port)) {
return false;
}