resource->type()) { case 'application': $persistentStorages = $this->resource?->persistentStorages()?->get(); StopApplication::run($this->resource, previewDeployments: true); break; case 'standalone-postgresql': case 'standalone-redis': case 'standalone-mongodb': case 'standalone-mysql': case 'standalone-mariadb': case 'standalone-keydb': case 'standalone-dragonfly': case 'standalone-clickhouse': $persistentStorages = $this->resource?->persistentStorages()?->get(); StopDatabase::run($this->resource); break; case 'service': StopService::run($this->resource); DeleteService::run($this->resource); break; } if ($this->deleteVolumes && $this->resource->type() !== 'service') { $this->resource?->delete_volumes($persistentStorages); } if ($this->deleteConfigurations) { $this->resource?->delete_configurations(); } } catch (\Throwable $e) { ray($e->getMessage()); send_internal_notification('ContainerStoppingJob failed with: '.$e->getMessage()); throw $e; } finally { $this->resource->forceDelete(); Artisan::queue('cleanup:stucked-resources'); } } }