问题
Based on the documentation of Laravel to delay the job, we can add a $delay properties on the listener class (https://laravel.com/docs/8.x/events). I am trying to customize the $delay time in seconds that based on my start time and end time.
From documentation which it's work fine:
/**
* The time (seconds) before the job should be processed.
*
* @var int
*/
public $delay = 60;
I am trying to:
public $delay;
public function __construct ($event) {
$this->delay= $event->seconds;
}
and I tried this for making sure it will work but unfortunate not:
public $delay;
public function __construct () {
$this->delay= "60";
}
来源:https://stackoverflow.com/questions/64727992/laravel-set-queue-delay-dynamically-for-event-listener