改名
This commit is contained in:
@@ -177,6 +177,7 @@ class ServerInotify extends Process
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重启
|
* 重启
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function trigger_reload()
|
public function trigger_reload()
|
||||||
{
|
{
|
||||||
|
|||||||
+12
-1
@@ -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 int $fd
|
||||||
* @param $data
|
* @param $data
|
||||||
@@ -324,10 +334,11 @@ class Snowflake
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function reload()
|
public static function reload()
|
||||||
{
|
{
|
||||||
return Snowflake::app()->server->getServer()->reload();
|
return Process::kill(Snowflake::getMasterPid(), SIGUSR1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user