server = $server; $this->attempts = 2; } public function handle(): void { if ($this->server->provider()->isRunning()) { $this->server->install(); } else { $this->attempts--; if ($this->attempts > 0) { sleep(120); $this->handle(); } else { event(new Broadcast('install-server-failed', $this->server->toArray())); } } } }