Files
newznab-tmux-NNTmux/app/Console/Commands/ProcessBinaries.php
T
2025-12-19 13:12:13 +01:00

45 lines
1019 B
PHP

<?php
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;
}
}
}