Files
panel-pelican-dev/app/Jobs/InstallEgg.php
Charles bed9dbeb2b Add Eggs to Installer (#2004)
Co-authored-by: Boy132 <mail@boy132.de>
2025-12-29 17:24:02 -05:00

34 lines
886 B
PHP

<?php
namespace App\Jobs;
use App\Services\Eggs\Sharing\EggImporterService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use Throwable;
class InstallEgg implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public int $timeout = 15;
public function __construct(public string $downloadUrl) {}
/**
* @throws Throwable
*/
public function handle(EggImporterService $eggImporterService): void
{
try {
$eggImporterService->fromUrl($this->downloadUrl);
} catch (Throwable $e) {
Log::error('Failed to install egg from URL: ' . $this->downloadUrl, ['exception' => $e]);
}
}
}