This commit is contained in:
2021-01-28 11:27:53 +08:00
parent f8c79b148e
commit fb0d3a4b9b
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -225,7 +225,7 @@ class Snowflake
*/
public static function getWebSocket(): ?Server
{
$server = static::app()->server->getServer();
$server = static::app()->getSwoole();
if (!($server instanceof Server)) {
return null;
}
@@ -273,7 +273,7 @@ class Snowflake
*/
public static function async(string $class, array $params = [])
{
$server = static::app()->server->getServer();
$server = static::app()->getSwoole();
if (!isset($server->setting['task_worker_num']) || !class_exists($class)) {
return;
}
@@ -317,7 +317,7 @@ class Snowflake
*/
public static function shutdown($process): void
{
static::app()->server->getServer()->shutdown();
static::app()->getSwoole()->shutdown();
if ($process instanceof Process) {
$process->exit(0);
}