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.