我有一个简单的设置计划命令,该命令在cron调用中触发
artisan命令可以正常工作,但在计划时什么也没发生
时间表
protected function schedule(Schedule $schedule)
{
$schedule->command('prices:pricing')
->everyMinute();
}
任务
protected $signature = 'prices:pricing';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Gets Pricing data and stores in DB';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
Log::debug('An informational message.');
}
}
cron
* * * * * www-data cd /var/www/api && php artisan schedule:run >> /dev/null 2>&1
我也尝试过运行
php artisan queue:listen