application = $application; $this->container_name = $container_name; $this->pull_request_id = $pull_request_id; } public function uniqueId(): string { return $this->container_name; } public function handle(): void { try { $status = get_container_status(server: $this->application->destination->server, container_id: $this->container_name, throwError: false); if ($this->pull_request_id) { $preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id); $preview->status = $status; $preview->save(); } else { $this->application->status = $status; $this->application->save(); } } catch (\Exception $e) { Log::error($e->getMessage()); } } protected function check_container_status() { if ($this->application->destination->server) { $this->application->status = get_container_status(server: $this->application->destination->server, container_id: $this->application->uuid); $this->application->save(); } } }