failed() method not getting hit after a job is failed
Hi,
I am running few jobs and trying to setup a failed() public method within the job itself. Though even after throw a manual exception i can see that the job is failed and sent into failed_jobs table but the failed method is not getting hit.
Here is my code
public function failed(Exception $exception)
{
// Send user notification of failure, etc...
Log::channel('jobs')->error('Catalog Sync Failed for Merchant');
}
Did you restart your queue worker after changing the code? Your worker caches the PHP code, so on every change you need to restart the queue. The same goes for deployments.
If you set your drive to sync you can much easier test this. This way you don't have to restart the worker, because there is no worker.