<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;

class HorizonFlush extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'app:horizon-flush';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Flush all Failed Jobs';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        // Redis::connection(name: 'horizon')->client()->flushAll();
        Redis::command('flushdb');
        $this->info('failed_jobs flushed');
        return 0;
    }
}
