Files
newznab-tmux/app/Console/Commands/ProcessBinaries.php
T
DariusIII 9838128fd6 CS fixes
2025-11-01 22:22:13 +01:00

45 lines
1.0 KiB
PHP

<?php
namespace App\Console\Commands;
use Blacklight\libraries\Forking;
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 Forking)->processWorkType('binaries', [0 => $max]);
return self::SUCCESS;
} catch (\Exception $e) {
Log::error($e->getMessage());
$this->error($e->getMessage());
return self::FAILURE;
}
}
}