Files
newznab-tmux/app/Console/Commands/ProcessBinaries.php
2026-02-26 14:26:07 +01:00

47 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Console\Commands;
use App\Services\ForkingService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
class ProcessBinaries extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'multiprocessing:binaries
{max=0 : Maximum new headers to download per group (0 = no limit)}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Download new headers for all active groups using multiprocessing';
/**
* Execute the console command.
*/
public function handle(): int
{
$max = (int) $this->argument('max');
try {
(new ForkingService)->binaries($max);
return self::SUCCESS;
} catch (\Exception $e) {
Log::error($e->getMessage());
$this->error($e->getMessage());
return self::FAILURE;
}
}
}