<?php

declare(strict_types=1);

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Console\Scheduling\Schedule;

/**
 * Class ScheduleServiceProvider
 *
 * @package App\Providers
 */
final class ScheduleServiceProvider extends ServiceProvider
{
    /**
     * @return void
     */
    public function boot(): void
    {
        $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
            $schedule->command('queue:retry all')
                ->everyThirtyMinutes()
                ->withoutOverlapping(10)
                ->onOneServer()
                ->runInBackground()
                ->emailOutputOnFailure('it@seka.sk');;
        });
    }
}
