kinshara's avatar

Mail Later takes too much time.

Hi guys, I am developing e-commerce website which it send an email after registration. that feature took so much time for user to move on to next step. I tried to figure it out. and I got it. it is Mail function

Mail::later(5, $view,$email_data, function($message) use($to,$subject){
            $message->to($to)->subject($subject);
        });

whenever I put this code to comment, the process will be done immediately. and it works the opposite way. the most weird one, this only occurs for the first time. but later when I tried to buy and the system will send again, this time will so fast.

I use sendgrid for my mail host. I really have no more idea how can this be happen.

Please help. Thank you for your time.

0 likes
3 replies
kinshara's avatar

I think I still use Sync for queue driver.. is that good? but I read that Sync driver is for local use only, is it true that with Sync driver it will still run the process immediately? anyway, Im still using Laravel 5.0

kinshara's avatar

I have already managed the queue by using database as the driver. but now the problem is I still confuse about the different between queue:listen and queue:work --daemon.

I read, its better to use queue:work --daemon. but all I doubt is, will it seek and fire another queue after the first one fired until no more job?? and will it stop and exit after that? or it will standby like queue:listen?

if it only fire first queue, how can I set it to finish all queue? if not only the first, the next one is, will it stop or exit after that? if stop & exit, I can use cron job to run queue:work --daemon. but the problem will it overlap occured? if not exit or stop, thats mean it standy like queue:listen, how can I set in cpanel and where must I set this event?

thank you.

Please or to participate in this conversation.