diff options
Diffstat (limited to 'app/backends/sglomni/status.py')
| -rw-r--r-- | app/backends/sglomni/status.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/app/backends/sglomni/status.py b/app/backends/sglomni/status.py index 2b77307..6a47cff 100644 --- a/app/backends/sglomni/status.py +++ b/app/backends/sglomni/status.py @@ -3,8 +3,8 @@ from pathlib import Path from typing import List, Optional -from backends import BackendStatus, ServerSpec, envs, format_launch_hint, \ - probe, servers +from backends import BackendStatus, ServerSpec, common, envs, \ + format_launch_hint, probe, servers from backends.sglomni import gpu from backends.sglomni.catalog import ModelEntry, entry_by_repo, \ fallback_config_path, config_path @@ -101,15 +101,9 @@ def gpu_fallback_note(entry: ModelEntry) -> Optional[str]: def _port() -> int: - return _port_of(config.SGLOMNI_API_URL) - - -def _port_of(url: str) -> int: - import urllib.parse - try: - return urllib.parse.urlsplit(url).port or DEFAULT_PORT - except ValueError: - return DEFAULT_PORT + """The managed server's port (the configured URL's explicit port, + else the backend default).""" + return common.port_of(config.SGLOMNI_API_URL, DEFAULT_PORT) def _managed_running_entry() -> Optional[ModelEntry]: |
