This commit is contained in:
2020-10-14 11:21:56 +08:00
parent dcb08c31e0
commit 54e7069a20
2 changed files with 13 additions and 1 deletions
+12 -1
View File
@@ -223,6 +223,16 @@ class Snowflake
}
/**
* @return false|string
* @throws Exception
*/
public static function getMasterPid()
{
return file_get_contents(storage('socket.sock'));
}
/**
* @param int $fd
* @param $data
@@ -324,10 +334,11 @@ class Snowflake
/**
* @return mixed
* @throws Exception
*/
public static function reload()
{
return Snowflake::app()->server->getServer()->reload();
return Process::kill(Snowflake::getMasterPid(), SIGUSR1);
}