This commit is contained in:
as2252258@163.com
2021-03-20 03:54:21 +08:00
parent 0b3a4200f1
commit 3e34641bcd
+8 -4
View File
@@ -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);
}
}