问题可能超出了课程:
为了执行一些定时任务,我自己设置了一个指令: php think start
指令内容是执行swoole_timer_tick的定时任务。
定时任务里需要执行task任务。
为什么在自定义指令执行task任务时总是报错?
protected function execute(Input $input, Output $output) {
swoole_timer_tick(30000,function (){
$server = app('swoole.server');
$server->task(['page' => 4]);
});
}
}
