This commit is contained in:
as2252258@163.com
2021-03-20 03:13:36 +08:00
parent 2abe5bb6cf
commit 441ac7f3a9
+19 -7
View File
@@ -95,13 +95,25 @@ class CrontabProcess extends Process
$this->application->warning('execute crontab ' . date('Y-m-d H:i:s')); $this->application->warning('execute crontab ' . date('Y-m-d H:i:s'));
$content->execute($this); $content->execute($this);
}; };
$timer = $content->getTickTime() * 10; // $timer = $content->getTickTime() * 10;
if ($content->isLoop()) {
$content->setTimerId(Timer::tick($timer, $runTicker)); Timer::after(10000, function () use ($content) {
} else { $this->application->warning('execute crontab ' . date('Y-m-d H:i:s'));
$content->setTimerId(Timer::after($timer, $runTicker)); $content->execute($this);
} });
$this->names[$content->getName()] = $content;
// if ($content->isLoop()) {
// $content->setTimerId(Timer::tick($timer, function () use ($content) {
// $this->application->warning('execute crontab ' . date('Y-m-d H:i:s'));
// $content->execute($this);
// }));
// } else {
// $content->setTimerId(Timer::after($timer, function () use ($content) {
// $this->application->warning('execute crontab ' . date('Y-m-d H:i:s'));
// $content->execute($this);
// }));
// }
// $this->names[$content->getName()] = $content;
} }