*/ public array $backoff = [15, 45]; public int $timeout = 280; public function __construct( private readonly string $lab, private readonly string $base, ) { $this->onQueue('stock'); } public function handle(FabriqueStack $fabrique, StockChaud $stock): void { $fabrique->nettoyerEssais($this->base); $pret = $fabrique->fabriquer(DefinitionLab::depuis($this->lab), "{$this->base}-e{$this->attempts()}"); $stock->deposer($this->lab, $pret); $stock->commandeTerminee($this->lab, $this->base); $stock->reinitialiserEchecs($this->lab); } public function failed(?Throwable $exception): void { $stock = app(StockChaud::class); $stock->commandeTerminee($this->lab, $this->base); $stock->compterEchec($this->lab); Log::error("CreerStackStock : {$this->base} en échec après {$this->tries} essais", [ 'raison' => $exception?->getMessage(), ]); try { app(FabriqueStack::class)->nettoyerEssais($this->base); } catch (Throwable $e) { Log::error("CreerStackStock : nettoyage impossible pour {$this->base}", ['raison' => $e->getMessage()]); } } }