modify
This commit is contained in:
@@ -92,14 +92,25 @@ class CrontabProcess extends Process
|
|||||||
/** @var Crontab $content */
|
/** @var Crontab $content */
|
||||||
$content = unserialize($content);
|
$content = unserialize($content);
|
||||||
$runTicker = function (Crontab $crontab) {
|
$runTicker = function (Crontab $crontab) {
|
||||||
var_dump(get_called_class());
|
$this->application->warning('execute crontab '.date('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
if (!file_exists(APP_PATH . 'runTicker.log')) {
|
||||||
|
touch(APP_PATH . 'runTicker.log');
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents(APP_PATH . 'runTicker.log', date('Y-m-d H:i:s'), FILE_APPEND);
|
||||||
|
|
||||||
$crontab->execute($this);
|
$crontab->execute($this);
|
||||||
};
|
};
|
||||||
$timer = $content->getTickTime() * 1000;
|
$timer = $content->getTickTime() * 10;
|
||||||
var_dump($timer);
|
|
||||||
if ($content->isLoop()) {
|
if ($content->isLoop()) {
|
||||||
|
|
||||||
|
$this->application->warning('loop crontab');
|
||||||
|
|
||||||
$content->setTimerId(Timer::tick($timer, $runTicker, $content));
|
$content->setTimerId(Timer::tick($timer, $runTicker, $content));
|
||||||
} else {
|
} else {
|
||||||
|
$this->application->warning('after crontab');
|
||||||
|
|
||||||
$content->setTimerId(Timer::after($timer, $runTicker, $content));
|
$content->setTimerId(Timer::after($timer, $runTicker, $content));
|
||||||
}
|
}
|
||||||
$this->names[$content->getName()] = $content;
|
$this->names[$content->getName()] = $content;
|
||||||
|
|||||||
Reference in New Issue
Block a user