mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-22 02:24:38 +02:00
refactor: remove config_source flag from bootstrap settings
Database config is now the only option, no need for feature flag. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4376588baf
commit
a1e81bae8a
1 changed files with 46 additions and 61 deletions
|
|
@ -9,7 +9,7 @@ from functools import lru_cache
|
|||
from pathlib import Path
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import Field, field_validator
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
|
|
@ -33,21 +33,6 @@ class Settings(BaseSettings):
|
|||
default="INFO",
|
||||
description="Logging level",
|
||||
)
|
||||
config_source: Literal["toml", "db"] = Field(
|
||||
default="toml",
|
||||
description="Configuration source: 'toml' for TOML file, 'db' for database",
|
||||
)
|
||||
config_toml_path: Path = Field(
|
||||
default=Path("/etc/central/central.toml"),
|
||||
description="Path to TOML config file (when config_source=toml)",
|
||||
)
|
||||
|
||||
@field_validator("config_source")
|
||||
@classmethod
|
||||
def validate_config_source(cls, v: str) -> str:
|
||||
if v not in ("toml", "db"):
|
||||
raise ValueError(f"config_source must be 'toml' or 'db', got {v!r}")
|
||||
return v
|
||||
|
||||
|
||||
@lru_cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue