summaryrefslogtreecommitdiff
path: root/searx/favicons/proxy.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-10-17 21:17:26 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-10-29 13:50:38 +0100
commit3e5621e1af0e7540d342f395f1a8a26a8d19ad53 (patch)
treef2e7be697a1818ef5416c8a8fd0a24eb87bc551e /searx/favicons/proxy.py
parente392892578a881dc8ac500e6e277bd516702b140 (diff)
downloadsearxng-3e5621e1af0e7540d342f395f1a8a26a8d19ad53.tar.gz
searxng-3e5621e1af0e7540d342f395f1a8a26a8d19ad53.zip
[refactor] replace pydantic by msgspec
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/favicons/proxy.py')
-rw-r--r--searx/favicons/proxy.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/favicons/proxy.py b/searx/favicons/proxy.py
index 8cefe6c59..924092c80 100644
--- a/searx/favicons/proxy.py
+++ b/searx/favicons/proxy.py
@@ -12,7 +12,7 @@ import urllib.parse
import flask
from httpx import HTTPError
-from pydantic import BaseModel
+import msgspec
from searx import get_setting
@@ -41,7 +41,7 @@ def _initial_resolver_map():
return d
-class FaviconProxyConfig(BaseModel):
+class FaviconProxyConfig(msgspec.Struct):
"""Configuration of the favicon proxy."""
max_age: int = 60 * 60 * 24 * 7 # seven days
@@ -59,7 +59,7 @@ class FaviconProxyConfig(BaseModel):
outgoing request of the resolver. By default, the value from
:ref:`outgoing.request_timeout <settings outgoing>` setting is used."""
- resolver_map: dict[str, str] = _initial_resolver_map()
+ resolver_map: dict[str, str] = msgspec.field(default_factory=_initial_resolver_map)
"""The resolver_map is a key / value dictionary where the key is the name of
the resolver and the value is the fully qualifying name (fqn) of resolver's
function (the callable). The resolvers from the python module