oguzhankarabulut
2 weeks ago

Laravel Kill Queue Job

Posted 2 weeks ago by oguzhankarabulut

I am using laravel 5.6 in my project and i needed a queue jobs. I decided to use Amazon Sqs and i connected my application with aws successfully. I create a queue job file with using command:

php artisan make:job MakeAmazingJob

After that laravel generate a Jobs folder and MakeAmazingJob file. After that with using command:

php artisan queue:listen I started my job and it worked succesfully. Then i remove this MakeAmazingJob file and and generate new job file with command:

php artisan make:job MakeMoreAmazingJob

Then i want to start my new job and and started with command:

php artisan queue:listen

And in terminal output was:

[2020-03-20 12:33:54][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:55][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeMoreAmazingJob [2020-03-20 12:33:55][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processed: App\Jobs\MakeMoreAmazingJob [2020-03-20 12:33:55][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:56][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:56][1b66ac1a-7071-4878-a565-d4a3895bc243] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:57][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:57][1b66ac1a-7071-4878-a565-d4a3895bc243] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:58][382e78ad-ed37-4e08-8f02-a292ebf29cbd] Processing: App\Jobs\MakeAmazingJob [2020-03-20 12:33:58][1b66ac1a-7071-4878-a565-d4a3895bc243] Processing: App\Jobs\MakeAmazingJob Infnitely..

After this output i googled because i excepted and should be laravel should not try process removed job and i found a solution it was a use this command:

sudo php artisan queue:restart

And i tried and used this command after i started again my jobs, still result is same. Laravel is trying infinitely process to removed job. So, how can kill the removed queue job?

Thanks!

Please sign in or create an account to participate in this conversation.