From da40529ee3d2b5d5e9807f6a193144278ecb5d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 1 Mar 2021 17:33:01 +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/Abstracts/BaseApplication.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/System/Abstracts/BaseApplication.php b/System/Abstracts/BaseApplication.php index 9ec48090..c8f9ff97 100644 --- a/System/Abstracts/BaseApplication.php +++ b/System/Abstracts/BaseApplication.php @@ -116,16 +116,18 @@ abstract class BaseApplication extends Service $this->taskNumber = 0; $this->state = 'SWOOLE_WORKER_IDLE'; } - return $this->print_task_is_idle(); + return $this->print_task_is_idle(__METHOD__); } /** + * @param $method + * @return BaseApplication * @throws ComponentException */ - private function print_task_is_idle(): static + private function print_task_is_idle($method): static { - $this->warning(sprintf('%s:%d state %s has number %d', Snowflake::getEnvironmental(), env('worker'), $this->state, $this->taskNumber)); + $this->warning(sprintf('%s %s:%d state %s has number %d', $method, Snowflake::getEnvironmental(), env('worker'), $this->state, $this->taskNumber)); return $this; } @@ -143,7 +145,7 @@ abstract class BaseApplication extends Service } else { $this->state = 'SWOOLE_WORKER_BUSY'; } - return $this->print_task_is_idle(); + return $this->print_task_is_idle(__METHOD__); }