From 5b5deb45e9008a57d3bdb354c2f1d4e118ded1a0 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 20 Mar 2021 02:51:37 +0800 Subject: [PATCH] modify --- System/Crontab.php | 4 ++-- System/Process/CrontabProcess.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/System/Crontab.php b/System/Crontab.php index b3c2e756..f2289e5f 100644 --- a/System/Crontab.php +++ b/System/Crontab.php @@ -188,10 +188,10 @@ class Crontab extends BaseObject public function execute(): void { try { + var_dump('execute'); call_user_func($this->handler, $this->params); $this->execute_number += 1; - - if ($this->execute_number < $this->max_execute_number) { + if ($this->execute_number >= $this->max_execute_number) { $this->clearTimer(); } } catch (\Throwable $throwable) { diff --git a/System/Process/CrontabProcess.php b/System/Process/CrontabProcess.php index d0db8ffe..8565dea3 100644 --- a/System/Process/CrontabProcess.php +++ b/System/Process/CrontabProcess.php @@ -78,6 +78,7 @@ class CrontabProcess extends Process */ private function jobDelivery($content) { + /** @var Crontab $content */ $content = unserialize($content); $this->names[$content->getName()] = $content;