server->uuid))->expireAfter(60)->dontRelease()]; } public function __construct(public Server $server) {} public function handle() { try { $teamId = $this->server->team_id; // Stop proxy StopProxy::run($this->server, restarting: true); // Clear force_stop flag $this->server->proxy->force_stop = false; $this->server->save(); // Start proxy asynchronously to get activity $activity = StartProxy::run($this->server, force: true, restarting: true); // Store activity ID and dispatch event with it if ($activity && is_object($activity)) { $this->activity_id = $activity->id; ProxyStatusChangedUI::dispatch($teamId, $this->activity_id); } // Check Traefik version after restart (same as original behavior) if ($this->server->proxyType() === ProxyTypes::TRAEFIK->value) { $traefikVersions = get_traefik_versions(); if ($traefikVersions !== null) { CheckTraefikVersionForServerJob::dispatch($this->server, $traefikVersions); } else { Log::warning('Traefik version check skipped: versions.json data unavailable', [ 'server_id' => $this->server->id, 'server_name' => $this->server->name, ]); } } } catch (\Throwable $e) { // Set error status $this->server->proxy->status = 'error'; $this->server->save(); // Notify UI of error ProxyStatusChangedUI::dispatch($this->server->team_id); return handleError($e); } } }