From 2e29d4ee313643357d835f015a53ed7a65627ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 21 Oct 2020 15:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Error/ErrorHandler.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/System/Error/ErrorHandler.php b/System/Error/ErrorHandler.php index c56f4e22..c09ab526 100644 --- a/System/Error/ErrorHandler.php +++ b/System/Error/ErrorHandler.php @@ -62,6 +62,17 @@ class ErrorHandler extends Component implements ErrorInterface $message = array_shift($messages); + $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($lastError, true); + + Snowflake::writeFile(storage('shutdown.log'), $content, FILE_APPEND); + $this->sendError($message, $lastError['file'], $lastError['line']); }