[refactor] replace pydantic by msgspec

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2024-10-17 21:17:26 +02:00
committed by Markus Heiser
parent e392892578
commit 3e5621e1af
4 changed files with 25 additions and 22 deletions

View File

@@ -30,7 +30,7 @@ import tempfile
import time
import typer
from pydantic import BaseModel
import msgspec
from searx import sqlitedb
from searx import logger
@@ -90,7 +90,7 @@ def init(cfg: "FaviconCacheConfig"):
raise NotImplementedError(f"favicons db_type '{cfg.db_type}' is unknown")
class FaviconCacheConfig(BaseModel):
class FaviconCacheConfig(msgspec.Struct): # pylint: disable=too-few-public-methods
"""Configuration of the favicon cache."""
db_type: Literal["sqlite", "mem"] = "sqlite"