From baeebfbb5e2673cf40f1a250e0e64459b6fa32f7 Mon Sep 17 00:00:00 2001 From: titrxw <1120309488@qq.com> Date: Sat, 28 Nov 2020 08:39:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Core/Task/TaskDispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Core/Task/TaskDispatcher.php b/Src/Core/Task/TaskDispatcher.php index bd70a2e8..9acbb75b 100644 --- a/Src/Core/Task/TaskDispatcher.php +++ b/Src/Core/Task/TaskDispatcher.php @@ -134,7 +134,7 @@ public function dispatchAsync(TaskMessage $message) { * @throws \Throwable */ protected function dispatchNow($message, $server = null, $taskId = null, $workerId = null) { - $server = $server ?? App::$server->getServer(); + $server = $server ?? (App::$server ? App::$server->getServer() : null); $taskId = $taskId ?? $this->getContext()->getCoroutineId(); $workId = $workerId ?? ($server ? $server->worker_id : $workerId);