jeudi 21 février 2019

Execution time takes a lot though i use queue laravel

i make function make for loop on users and send to their notification in pusher i execute commands

php artisan queue:table
php artisan migrat

then I create jop class

php artisan make:job myclassstofunctionjob

and I update this line in .env

QUEUE_DRIVER=database

and in handle function in myclassstofunctionjob i make this function

public function handle()
    {
sleep(10);
}

This is temporary, To preview the problem, I actually executed another code but the same problem

then i use it in anther controller

$myjob= (new myclassstofunctionjob());
         dispatch($myjob);

then I execute command

php artisan queue:work

then I test my function in my application ,all things work success but take a lot of time



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire