Clarify on-the-fly server names
All checks were successful
Build and Publish / build_and_publish (push) Successful in 45s

This commit is contained in:
Nexus 2024-06-11 01:15:25 +01:00
parent 954d01bca5
commit af11baeeaa
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -11,7 +11,7 @@ log = logging.getLogger(__name__)
class ServerConfig(BaseModel): class ServerConfig(BaseModel):
name: str = Field(min_length=1, max_length=32) name: str = Field(min_length=1, max_length=4096)
base_url: AnyHttpUrl base_url: AnyHttpUrl
gpu: bool = False gpu: bool = False
vram_gb: int = 4 vram_gb: int = 4
@ -66,7 +66,7 @@ def get_server(name_or_base_url: str) -> ServerConfig | None:
else: else:
if parsed.netloc and parsed.scheme in ["http", "https"]: if parsed.netloc and parsed.scheme in ["http", "https"]:
defaults = { defaults = {
"name": parsed.hostname, "name": ":temporary:-:%s:" % parsed.hostname,
"base_url": "{0.scheme}://{0.netloc}".format(parsed), "base_url": "{0.scheme}://{0.netloc}".format(parsed),
"gpu": False, "gpu": False,
"vram_gb": 2, "vram_gb": 2,