onQueue('high'); } public function handle(): void { $execution = GithubRunnerExecution::query()->with(['server', 'githubApp'])->find($this->executionId); if (! $execution) { return; } // Another Coolify instance manages a transferred server and its runners: never touch them from here. if ($execution->server?->isTransferredAway()) { Log::info('Skipped GitHub runner cleanup: the server was transferred to another instance', ['execution' => $execution->uuid]); ProvisionGithubRunnerJob::dispatchQueued($execution->github_app_id); return; } if ($execution->server) { instant_remote_process(GithubRunnerContainer::cleanupCommands($execution->uuid), $execution->server, false); } if ($execution->runner_id && $execution->githubApp) { try { (new GithubRunnerApi($execution->githubApp))->deleteRunner($execution->runner_id); } catch (\Throwable $e) { Log::warning('Could not remove GitHub runner', ['execution' => $execution->uuid, 'error' => $e->getMessage()]); } } ProvisionGithubRunnerJob::dispatchQueued($execution->github_app_id); } }