Add service categories and also unbreak things

This commit is contained in:
Helix K
2026-04-29 22:56:37 -05:00
parent 2791ed59e3
commit 6dd3371464
3 changed files with 35 additions and 19 deletions
+3
View File
@@ -10,6 +10,7 @@ class ServiceConfig(BaseModel):
name: str
type: Literal["http", "tcp"]
timeout: int = 5
category: str | None = None
class HTTPServiceConfig(ServiceConfig):
@@ -58,6 +59,8 @@ def load_cfg() -> Config:
if isinstance(cfg.services, dict):
print("Your services config is using a dict, which is deprecated.")
cfg.services = list(cfg.services.values())
cfg.services = sorted(cfg.services, key=lambda s: s.category or "")
except ValidationError as e:
raise SystemExit(str(e))