0

I have implemented laravel queue with supervisor on prod server. The problem i am facing is when i send mail for the first time in a day, the mail get delayed but the job is processed but after that first mail is received it works fine and there is no delay. I am facing this issue on daily basis that my first few mails get delayed and once they received everything works fine. How can i remove this initial delay of mail i am facing on daily basis. Below is my supervisor file.

[program:email-service]
process_name=%(program_name)s_%(process_num)02d
command=php path-to-project/artisan queue:work
autostart=true
autorestart=true
user=root
numprocs=3
redirect_stderr=true
stdout_logfile=path-to-project/storage/logs/email-service.log

Any help is appreciated.

  • So to clarify, the mail job is processed without delay but the mail itself is delivered with delay or is the job itself the one that is delayed to be processed? – apokryfos Jan 31 '22 at 08:16
  • mail job is processed without delay but the mail itself is delivered with delay and this is for the first time in a day only and for the few mails only and after that mails are delivered without delay. It is working fine in local where i didn't used supervisor but instead directly use the artisan queue:work command. – Love Sharma Jan 31 '22 at 08:27
  • I have just found something weird that whenever i am using new email in my application then mail is taking 5 mins to show in my inbox but when received it is showing original time when it is sent not when it is received in my inbox. and after this first mail received in my inbox it is working fine and receiving the mails quickly – Love Sharma Jan 31 '22 at 11:24
  • Sounds to me more of a mail routing issue. Might want to contact the service you are using to send emails (or if you're using sendmail or other built-in client then check your configuration) – apokryfos Jan 31 '22 at 12:47
  • yeah i guess also that its a mail service provider because i have seen the similar question but the tags are for the mail service provider i am using(sendgrid). Its a sendgrid issue still doesn't know how do i solve this @apokryfos – Love Sharma Jan 31 '22 at 12:57
  • It might be worth contacting sendgrid and telling them this issue in case this is a "known issue" to them or they have troubleshooting steps they can provide. – apokryfos Jan 31 '22 at 13:14
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 09 '22 at 19:01

0 Answers0