I am trying to execute a code after some delay using laravel 7 job queue. The constructor method is working but not the handle method. My code is given below:
Controller:
public function test()
{
echo 'starting ....';
$reset = (new ResetLockers())->delay(now()->addSeconds(10));
dispatch($reset);
}
Job:
class ResetLockers implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct()
{
echo 'constructing ...';
}
public function handle()
{
echo 'job dispatched';
}
}
database:
output:
any clue?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3neOSPx
via IFTTT
Aucun commentaire:
Enregistrer un commentaire