定时任务命令文件存放在crmeb\command\Timer.php
进程数设置
protected function execute(Input $input, Output $output)
{
$this->init($input, $output);
Worker::$pidFile = app()->getRootPath().'runtime/timer.pid';
$task = new Worker();
//设置进程数
$task->count = 1;
$task->onWorkerStart = function () {
event('CrontabListener');
};
$task->runAll();
}
定时器pid文件存放
存放在根目录下的runtime/timer.pid
Worker::$pidFile = app()->getRootPath().'runtime/timer.pid';
Was this helpful?
0 / 0