改名
This commit is contained in:
@@ -34,6 +34,18 @@ class OnShutdown extends Callback
|
|||||||
public function onHandler(Server $server)
|
public function onHandler(Server $server)
|
||||||
{
|
{
|
||||||
$this->debug('server shutdown~');
|
$this->debug('server shutdown~');
|
||||||
|
|
||||||
|
$workers = glob(storage(null, 'worker') . '/*');
|
||||||
|
foreach ($workers as $worker) {
|
||||||
|
$content = file_get_contents($worker);
|
||||||
|
posix_kill($content, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
$content = '[error]: ' . date('Y-m-d H:i:s') . PHP_EOL;
|
||||||
|
$content .= print_r(swoole_last_error(), true);
|
||||||
|
|
||||||
|
Snowflake::writeFile(storage('shutdown.log'), $content, FILE_APPEND);
|
||||||
|
|
||||||
$this->system_mail('server shutdown~');
|
$this->system_mail('server shutdown~');
|
||||||
$event = Snowflake::app()->getEvent();
|
$event = Snowflake::app()->getEvent();
|
||||||
$event->trigger(Event::SERVER_SHUTDOWN);
|
$event->trigger(Event::SERVER_SHUTDOWN);
|
||||||
|
|||||||
Reference in New Issue
Block a user