1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-15 01:00:12 +01:00

[fix] favicons: msgspec.ValidationError: Expected Path, got str - at $.favicons.cache.db_url

Closes: https://github.com/searxng/searxng/issues/3975
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2024-10-29 17:32:30 +01:00 committed by Markus Heiser
parent b183e620d8
commit fa4dfd4efe
2 changed files with 4 additions and 4 deletions

View File

@ -20,11 +20,11 @@
from __future__ import annotations from __future__ import annotations
from typing import Literal from typing import Literal
import os
import abc import abc
import dataclasses import dataclasses
import hashlib import hashlib
import logging import logging
import pathlib
import sqlite3 import sqlite3
import tempfile import tempfile
import time import time
@ -103,7 +103,7 @@ class FaviconCacheConfig(msgspec.Struct): # pylint: disable=too-few-public-meth
:py:obj:`.cache.FaviconCacheMEM` (not recommended) :py:obj:`.cache.FaviconCacheMEM` (not recommended)
""" """
db_url: pathlib.Path = pathlib.Path(tempfile.gettempdir()) / "faviconcache.db" db_url: str = tempfile.gettempdir() + os.sep + "faviconcache.db"
"""URL of the SQLite DB, the path to the database file.""" """URL of the SQLite DB, the path to the database file."""
HOLD_TIME: int = 60 * 60 * 24 * 30 # 30 days HOLD_TIME: int = 60 * 60 * 24 * 30 # 30 days

View File

@ -27,10 +27,10 @@ class FaviconConfig(msgspec.Struct): # pylint: disable=too-few-public-methods
By specifying a version, it is possible to ensure downward compatibility in By specifying a version, it is possible to ensure downward compatibility in
the event of future changes to the configuration schema""" the event of future changes to the configuration schema"""
cache: FaviconCacheConfig = FaviconCacheConfig cache: FaviconCacheConfig = msgspec.field(default_factory=FaviconCacheConfig)
"""Setup of the :py:obj:`.cache.FaviconCacheConfig`.""" """Setup of the :py:obj:`.cache.FaviconCacheConfig`."""
proxy: FaviconProxyConfig = FaviconCacheConfig proxy: FaviconProxyConfig = msgspec.field(default_factory=FaviconProxyConfig)
"""Setup of the :py:obj:`.proxy.FaviconProxyConfig`.""" """Setup of the :py:obj:`.proxy.FaviconProxyConfig`."""
@classmethod @classmethod