Skip to content

Commit

Permalink
[fix] favicons: msgspec.ValidationError: Expected Path, got str -…
Browse files Browse the repository at this point in the history
… at `$.favicons.cache.db_url`

Closes: searxng#3975
Signed-off-by: Markus Heiser <[email protected]>
  • Loading branch information
return42 committed Oct 29, 2024
1 parent b183e62 commit fa4dfd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions searx/favicons/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
from __future__ import annotations
from typing import Literal

import os
import abc
import dataclasses
import hashlib
import logging
import pathlib
import sqlite3
import tempfile
import time
Expand Down Expand Up @@ -103,7 +103,7 @@ class FaviconCacheConfig(msgspec.Struct): # pylint: disable=too-few-public-meth
: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."""

HOLD_TIME: int = 60 * 60 * 24 * 30 # 30 days
Expand Down
4 changes: 2 additions & 2 deletions searx/favicons/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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`."""

proxy: FaviconProxyConfig = FaviconCacheConfig
proxy: FaviconProxyConfig = msgspec.field(default_factory=FaviconProxyConfig)
"""Setup of the :py:obj:`.proxy.FaviconProxyConfig`."""

@classmethod
Expand Down

0 comments on commit fa4dfd4

Please sign in to comment.