From 1fe062b9cfe934680e07c04d376cecf34e108c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 10 Sep 2020 19:30:49 +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 --- Queue/Queue.php | 8 +++++++- System/Abstracts/BaseObject.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Queue/Queue.php b/Queue/Queue.php index cde52628..6a5296e6 100644 --- a/Queue/Queue.php +++ b/Queue/Queue.php @@ -81,7 +81,13 @@ class Queue extends \Snowflake\Process\Process */ public function delivery(Consumer $consumer, $score = 0) { - $this->waiting->add($consumer, $score); + try { + $consumer->onWaiting(); + } catch (\Throwable $exception) { + $this->application->error($exception->getMessage()); + } finally { + $this->waiting->add($consumer, $score); + } } diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index caae0144..dec00e44 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -169,7 +169,7 @@ class BaseObject implements Configure * @param string $message * @param string|null $method * @param string|null $file - * @throws Exception + * @throws */ public function error($message, $method = null, $file = null) {