Cron Job in Ubuntu creating multiple instances

戏子无情 提交于 2021-01-29 08:33:53

问题


Please Help.

I have created a API which will call a sms API and send the sms. My code flow is like - The API(Mobile Number as parameter) hit my code - I have storing the mobile in my database and then dispatch a job.

in my ubuntu serve I have added this line in crontab -e editor

 * * * * * cd /var/www/html/project&& php /var/www/html/project/artisan schedule:run >> /dev/null 2>&1

and my scheduler in laravel is

$schedule->exec('php artisan queue:work')->everyMinute();

and I tried sudo service cron status its showing

the report seems, its creating lot of cron jobs. I dont understand where I missed , what mistake I did here.

is it because of my laravel scheduler code?

In my Job I am hitting my Database. So it showing too many connection error in laravel

Please help my to figure this out.

THanks

来源:https://stackoverflow.com/questions/62738305/cron-job-in-ubuntu-creating-multiple-instances

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!