modify
This commit is contained in:
@@ -76,17 +76,18 @@ class CrontabProcess extends Process
|
|||||||
private function jobDelivery($content)
|
private function jobDelivery($content)
|
||||||
{
|
{
|
||||||
$content = unserialize($content);
|
$content = unserialize($content);
|
||||||
var_dump($content);
|
|
||||||
$this->names[$content->getName()] = $content;
|
$this->names[$content->getName()] = $content;
|
||||||
if (!($content instanceof Crontab)) {
|
if (!($content instanceof Crontab)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$runTicker = [$content, 'execute'];
|
$runTicker = function (Crontab $crontab) {
|
||||||
|
$crontab->execute();
|
||||||
|
};
|
||||||
$timer = $content->getTickTime() * 1000;
|
$timer = $content->getTickTime() * 1000;
|
||||||
if ($content->isLoop()) {
|
if ($content->isLoop()) {
|
||||||
$timerId = Timer::tick($timer, $runTicker);
|
$timerId = Timer::tick($timer, $runTicker, $content);
|
||||||
} else {
|
} else {
|
||||||
$timerId = Timer::after($timer, $runTicker);
|
$timerId = Timer::after($timer, $runTicker, $content);
|
||||||
}
|
}
|
||||||
$content->setTimerId($timerId);
|
$content->setTimerId($timerId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user