From 7106b114f18a99b85314574b7500d59abcd394ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 23 Jul 2021 18:00:18 +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/Crontab/Crontab.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/System/Crontab/Crontab.php b/System/Crontab/Crontab.php index 66fa80fd..ccf2a371 100644 --- a/System/Crontab/Crontab.php +++ b/System/Crontab/Crontab.php @@ -193,6 +193,7 @@ abstract class Crontab implements PipeMessage */ public function execute(): void { + defer(fn() => $this->afterExecute()); try { $redis = $this->application->getRedis(); @@ -204,8 +205,6 @@ abstract class Crontab implements PipeMessage $redis->hDel(self::WAIT_END, $name_md5); } catch (\Throwable $throwable) { $this->application->addError($throwable, 'throwable'); - } finally { - $this->afterExecute(); } }