1

dispatch((new placeJob($data))->onQueue('important'));

this line calls the job constructor, but log statement and any other statement in handle function is not working.

i'm trying to dispatch the job. but the handle function in job is not working. i'm expecting that handle function should work!

arunaji601
  • 11
  • 4
  • Welcome to SO! Please provide more details as possible about your issue; how your job code looks like, what have you tried so far, any errors, and your setup environment (supervisor config, versions, etc...) – sykez Mar 30 '22 at 05:31
  • What is your QUEUE_CONNECTION? If it is not sync - than you need to php artisan queue:work – Maksim Mar 30 '22 at 05:52
  • hi @Maksim, handle function is not working, i doubt that job is scheduled in queue or not ? – arunaji601 Mar 30 '22 at 05:56
  • hi @sykez 1. from console kernel i schedule the job $schedule->command('orders:processOrders')->everyFiveMinutes(); 2. from command processOrders i'll call the other command $this->call('orders:placeOrder'); 3. in that command ill call the dispatch dispatch((new OrdersJob($data))->onQueue('important')); 4.with constructor and handle function there is job named OrdersJob in app/Jobs there i create job status with data that's all! – arunaji601 Mar 30 '22 at 06:02
  • hi @syk environment setup for job queues. Queue_connection=database Queue_driver=database – arunaji601 Mar 30 '22 at 06:03
  • Are you running the queue? Check your DB if your job is created. – sykez Mar 30 '22 at 17:05
  • @sky queue is running when i use php artisan queue:work "name" command but other time job is not creating in db ? have configure supervisor in system? OR How to run queue automated? – arunaji601 Apr 06 '22 at 05:04

0 Answers0