aboutsummaryrefslogtreecommitdiff
path: root/app/backends/sglomni/status.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-04 17:41:43 -0400
committerhistoria <historiavg@proton.me>2026-09-04 17:41:43 -0400
commit0157ce4a347f9625e1e9d09e2bbf0fbfad722557 (patch)
treea2239553d7e8ac5cdb5931ad49482487e1f49905 /app/backends/sglomni/status.py
parent5263a30356d7a7b39490e9a3cf5f6c179249500c (diff)
downloadtts-audiobook-generator-0157ce4a347f9625e1e9d09e2bbf0fbfad722557.tar.gz
fix: sglomni retry contract, booting detection, CLI keys, companion refresh, ffmpeg depHEADmain
Diffstat (limited to 'app/backends/sglomni/status.py')
-rw-r--r--app/backends/sglomni/status.py16
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]: