1
我在Ubuntu 14.04服務器中使用數據庫驅動程序實現了laravel隊列。我執行此代碼Laravel數據庫排隊作業嘗試
php /path to app/artisan queue:listen --tries=3 --env=local
它說試試= 3。但是當我看到就業表時,我看到有22次嘗試的工作,這怎麼可能?它應該嘗試3次,然後將其添加到failed_jobs表中。
此外,在作業表中reserved_at意味着什麼?
謝謝
這裏是,順便說一下,它完美
<?php
namespace App\Jobs;
use App\Jobs\Job;
use App\Notifiers\Im_Notification;
use App\Notifiers\Notification;
use App\Notifiers\Mail_Notification;
use App\Reservation;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class NotifyPlaceReservationStatus extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
protected $notification;
protected $reservation;
protected $info_changed;
public function __construct(Notification $notification,Reservation $reservation)
{
$this->reservation = $reservation;
$this->notification = $notification;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$this->notification->notifyPlaceReservationStatus($this->reservation);
}
public function failed()
{
error_log('Job failed');
}
}
你應該顯示作業它自我。問題可能在於此。 –
好吧,我把它。謝謝 –