I am using Laravel Horizon to handle queued jobs. Below is my code
<?php
namespace App\Jobs;
class ProcessPodcast implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $podcast;
public function handle(AudioProcessor $processor)
{
// Process uploaded podcast...
Log::channel('slack')->send('Processing ...');
}
}
In the job handle method, I have logging to slack channel. When this type of queued jobs is executed, I got the slack msg.
Sometimes, I say 1% to 5%, when I dispatched job ProcessPodcast::dispatch()
, I didn't get the slack message. And I didn't get the job showed up under Horizon Failed Job page. This behaviors is totally random. It is very hard to reproduce. I am thinking that:
Case #1: Laravel did not create the job, therefore, no job is executed
Case #2: Laravel created the job, but Horizon didn't run the job
In either case, it would be very helpful to check if a job ProcessPodcast
is saved to Redis. I don't think this is possible with Redis.
Please provide recommendations on how to debug this issue.
php artisan queue work
orphp artisan horizon
? – Clément Baconnier Jul 24 '19 at 7:06horizon:123
(123 is the id of the job). I have to go inside each job (in redis), and look inside theProcessPodcast
. It is impossible to do manually considered the number of jobs are queued per minute – Michael Nguyen Jul 24 '19 at 14:26redis-cli monitor | grep -E ' "ProcessPodcast" '
I don't think it will help you much, but that's the only solution I have in mind to see if a job is effectively pushed on Redis – Clément Baconnier Jul 24 '19 at 15:33