<?php

namespace App\Console\Commands;

use App\Services\Meet\RecordingService;
use Illuminate\Console\Command;

class FailStaleMeetRecordingsCommand extends Command
{
    protected $signature = 'meet:fail-stale-recordings';

    protected $description = 'Mark Meet recordings stuck in processing as failed';

    public function handle(RecordingService $recordings): int
    {
        $failed = $recordings->failStaleProcessingRecordings();

        $this->info("Marked {$failed} stale recording(s) as failed.");

        return self::SUCCESS;
    }
}
