PHP code example of therealedatta / laravel-queue-health-check

1. Go to this page and download the library: Download therealedatta/laravel-queue-health-check library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

therealedatta / laravel-queue-health-check example snippets


use Illuminate\Support\Facades\Event;
use TheRealEdatta\QueueHealthCheck\Events\QueueUnhealthy;

Event::listen(function (QueueUnhealthy $event) {
    Slack::to('#ops')->send("Queue {$event->issue->value} for {$event->minutes} min on {$event->hostname}");
});

config()->set('queue-health.storage_path', sys_get_temp_dir().'/queue-health-'.getmypid());
bash
php artisan queue-health:status
bash
php artisan queue-health:status || echo "queue is not healthy"
bash
php artisan queue-health:test [email protected]
bash
php artisan queue-health:test