我的队列配置 的配置/队列:
'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工作?如果手动运行它。
答案 0 :(得分:0)
$schedule->exec('sudo supervisorctl stop laravel-worker:*')->everyMinute()->withoutOverlapping();
$schedule->exec('sudo supervisorctl start laravel-worker:*')->everyMinute()->withoutOverlapping();