laravel-scheduler

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

Laravel Scheduling Task on AWS is not working

ⅰ亾dé卋堺 提交于 2021-01-27 06:41:22
问题 I am deploying my Laravel application to ElasticBeanstalk environment. I am trying to run a command in the Scheduling Task on the server. But it is not working. This is what I have done. I schedule my command in the Kernel.php file as follow. $schedule->command('counter:update')->everyMinute()->onOneServer(); I am using Redis as my cache driver and it is working. Then I tried two different approaches. First Approach: Using Laravel AWS Worker package , https://packagist.org/packages/dusterio

Laravel Scheduling Task on AWS is not working

╄→尐↘猪︶ㄣ 提交于 2021-01-27 06:40:19
问题 I am deploying my Laravel application to ElasticBeanstalk environment. I am trying to run a command in the Scheduling Task on the server. But it is not working. This is what I have done. I schedule my command in the Kernel.php file as follow. $schedule->command('counter:update')->everyMinute()->onOneServer(); I am using Redis as my cache driver and it is working. Then I tried two different approaches. First Approach: Using Laravel AWS Worker package , https://packagist.org/packages/dusterio

Laravel 5 schedule job every 30 seconds

青春壹個敷衍的年華 提交于 2019-12-30 13:41:57
问题 I am using Laravel schedule to run cron jobs. In my crontab I have added (with correct path to my project): * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 Now my App\Console\Kernel.php looks like: protected function schedule(Schedule $schedule) { $schedule->command('investments:calculate_interests')->everyMinute(); $schedule->call('\App\Http\Controllers\UsersController@testEvent')->everyMinute(); } Using it like that I successfully run jobs every minute. But how I can change it

Laravel 5 schedule job every 30 seconds

て烟熏妆下的殇ゞ 提交于 2019-12-30 13:41:30
问题 I am using Laravel schedule to run cron jobs. In my crontab I have added (with correct path to my project): * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 Now my App\Console\Kernel.php looks like: protected function schedule(Schedule $schedule) { $schedule->command('investments:calculate_interests')->everyMinute(); $schedule->call('\App\Http\Controllers\UsersController@testEvent')->everyMinute(); } Using it like that I successfully run jobs every minute. But how I can change it

Laravel run multiple scheduled tasks

…衆ロ難τιáo~ 提交于 2019-12-04 00:48:11
问题 I currently have a scheduled console command that runs every 5 minutes without overlap like this: $schedule->command('crawler') ->everyFiveMinutes() ->withoutOverlapping() ->sendOutputTo('../_laravel/storage/logs/scheduler-log.txt'); So it works great, but I currently have about 220 pages that takes about 3 hours to finish in increments of 5 minutes because I just force it to crawl 10 pages at each interval since each page takes like 20-30 seconds to crawl due to various factors. Each page is

Laravel 5 schedule job every 30 seconds

我们两清 提交于 2019-12-01 13:57:28
I am using Laravel schedule to run cron jobs. In my crontab I have added (with correct path to my project): * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 Now my App\Console\Kernel.php looks like: protected function schedule(Schedule $schedule) { $schedule->command('investments:calculate_interests')->everyMinute(); $schedule->call('\App\Http\Controllers\UsersController@testEvent')->everyMinute(); } Using it like that I successfully run jobs every minute. But how I can change it to run them on every 10 or 20 or 30 seconds? I solved it with this code: public function handle() {

Laravel run multiple scheduled tasks

≯℡__Kan透↙ 提交于 2019-12-01 03:16:06
I currently have a scheduled console command that runs every 5 minutes without overlap like this: $schedule->command('crawler') ->everyFiveMinutes() ->withoutOverlapping() ->sendOutputTo('../_laravel/storage/logs/scheduler-log.txt'); So it works great, but I currently have about 220 pages that takes about 3 hours to finish in increments of 5 minutes because I just force it to crawl 10 pages at each interval since each page takes like 20-30 seconds to crawl due to various factors. Each page is a record in the database. If I end up having 10,000 pages to crawl, this method would not work because