From 3e34641bcd021ece2f0659a255ce2a2ae0ecf99d Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 20 Mar 2021 03:54:21 +0800 Subject: [PATCH] modify --- System/Process/CrontabProcess.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/System/Process/CrontabProcess.php b/System/Process/CrontabProcess.php index e19666dd..d9b15dbb 100644 --- a/System/Process/CrontabProcess.php +++ b/System/Process/CrontabProcess.php @@ -114,13 +114,17 @@ class CrontabProcess extends Process { /** @var Crontab $content */ $content = unserialize($content); - $runTicker = [$content->getTickTime() * 1000, function () use ($content) { + + $name = $content->getName(); + $callback = function () use ($content) { + var_dump('executes'); $content->execute($this); - }]; + }; + $runTicker = [$content->getTickTime() * 1000, $callback]; if ($content->isLoop()) { - $this->names[$content->getName()] = Timer::tick(...$runTicker); + $this->names[$name] = Timer::tick(...$runTicker); } else { - $this->names[$content->getName()] = Timer::after(...$runTicker); + $this->names[$name] = Timer::after(...$runTicker); } }