【发布时间】:2018-02-16 22:53:08
【问题描述】:
我的队列配置 配置/队列:
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
//'table' => 'jobs',
'table' => 'ncste_jobs',
'queue' => 'default',
'expire' => 60,
],
],
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'ncste_failed_jobs',
],
Konsole/Kernel.php:
protected function schedule(Schedule $schedule)
{
//here som comand
$schedule->command('sudo supervisorctl stop laravel-worker:*')->name('supervisorctl-stop')->everyMinute()->withoutOverlapping();
$schedule->command('sudo supervisorctl start laravel-worker:*')->name('supervisorctl-start')->everyMinute()->withoutOverlapping();
//here some command
}
Cron:
* * * * * /usr/bin/php /var/www/mydomain.com/artisan schedule:run 1>>/dev/null 2>&1
为什么这两个命令不能通过 cron 工作?如果手动运行,它可以工作。
【问题讨论】: