Category : laravel-queue

So basically, I have these long-running jobs that happen on a schedule basis, but also can be queued by a user manually. The job recreates a table from other tables, which takes 10mins~, but… I am using laravel vapor(which uses SQS for queues) and after 60seconds the job times out(even though the process is still ..

Read more

My Laravel (7.15) application with cron-job contains two commands which executes daily at certain time period. php artisan report:generate php artisan report:send-mail report:generate command executes once while report:send-mail executes in every 5 mins. Until yesterday in production QUEUE_CONNECTION was sync and it was working perfectly. But the problem is my reports contain large & complex ..

Read more

I am using laravel notifications with queues. Here’s my code: <?php namespace AppNotifications; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateNotificationsMessagesMailMessage; use IlluminateNotificationsNotification; use JetBrainsPhpStormArrayShape; class SendVerifyEmailOTP extends Notification implements ShouldQueue { use Queueable; protected string $name, $email, $otp, $uniq_id; /** * Create a new notification instance. * * @param $name * @param $email * @param $otp ..

Read more

I am trying to run different jobs in parallel. I have tried 3 ways but both unsuccessful so far. I have to simplify 3 queues: A,B and C I run queue:work 3 times using Artisan::call (just showing one as example): Artisan::call(‘queue:work’, [ ‘–stop-when-empty’ => ”, ‘–queue’ => ‘A’, ‘–tries’ => 1 ]); This runs sequential, ..

Read more

i am trying to fire event from laravel scheduler with interval every minutes. laravel version that i use is version 8. from php artisan queue:listen, the queue processing is failed. when i see the log, following exception found. pcntl_alarm() expects parameter 1 to be int, string given {"exception":"[object] (ErrorException(code: 0): pcntl_alarm() expects parameter 1 to ..

Read more

My Project consumes several 3rd party APIs which enforce requests limiting. My Project calls these api’s through Laravel Jobs. I am using using Spatie/aravel-rate-limited-job-middleware for rate limiting Once a Project is submitted, around 60 jobs are dispatched on an average. These jobs needs to be executed as 1 Job/Minute There is one supervisord program running ..

Read more

I have a problem where multiple workers are taking the same job, even when I have the following settings: class WaitingForUpload implements ShouldQueue, ShouldBeUnique { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $uploadJob; public $tries = 3; public $backoff = 60; public $timeout = 1500; public $retryAfter = 1560; } On Supervisord I have the following ..

Read more

I have function which i am calling inside the job . and i am dispatching that job inside loop like this. foreach ($consignments as $consignment) { $jobs[] = new CalculateSingleConsignment($consignment, $total_consignments, $i, $user_id,$notify); } This code means that i am calling that function inside the loop. However this job is in chain so these jobs ..

Read more

There is function which is inside job (queue) . and I dispatch that queue. Inside foreach loop. public function autoConsignmentChargeCalculate($consignments, $user_id, $notify) { $i = 1; $total_consignments = $consignments->count(); $jobs = []; foreach ($consignments as $consignment) { $jobs[] = new CalculateSingleConsignment($consignment, $total_consignments, $i, $user_id, $notify); $i++; } if (count($jobs) > 0) { Bus::chain($jobs)->onQueue(‘invoice’)->dispatch(); } } ..

Read more

I know the jobs are supposed to run asynchronously and they do not suppose to return a value. Still, I’m looking for a solution to somehow pass "up" information obtained in the job. It doesn’t have to be by a return statement, it can be by some other $this->variable in the service or any other ..

Read more

I am using laravel 7 and I have a queue which I dispatch from artisan tinker. I have configured the queue to work from database. The job itself is correctly written to the jobs table, but it gets never executed. In the table, I can see the entry, but with 0 attempts. To make sure, ..

Read more

I am trying to dispatch a job by laravel queue:work using supervisor in the live server (CentOS 7). Supervisor is running but the job is not processing. I am getting following error: My worker file is : [program:queue-worker] process_name=%(program_name)s_%(process_num)02d command=php /home/maomin/public_html/bvend.xyz/artisan queue:work sqs –sleep=3 –tries=3 –max-time=3600 –daemon autostart=true autorestart=true stopasgroup=true killasgroup=true user=apache numprocs=8 redirect_stderr=true stdout_logfile=/home/maomin/public_html/bvend.xyz/w.log ..

Read more

I am building a web application using Laravel’s lumen framework. I am writing integration and unit tests for my application. I am using Jobs in my application to do heavy tasks in the background, https://laravel.com/docs/8.x/queues. Normally, within the tests, I fake and assert if the job is pushed into the queue as follow. Queue::fake(); Queue::assertPushed(SendEmails::class); ..

Read more