.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
core.py
Go to the documentation of this file.
1# SPDX-License-Identifier: AGPL-3.0-or-later
2# pylint: disable=missing-module-docstring
3from __future__ import annotations
4
5import pathlib
6
7from searx import logger
8from searx.cache import ExpireCacheCfg, ExpireCacheSQLite
9
10log = logger.getChild("data")
11
12data_dir = pathlib.Path(__file__).parent
13
14_DATA_CACHE: ExpireCacheSQLite = None # type: ignore
15
16
18
19 global _DATA_CACHE # pylint: disable=global-statement
20
21 if _DATA_CACHE is None:
22 _DATA_CACHE = ExpireCacheSQLite.build_cache(
24 name="DATA_CACHE",
25 # MAX_VALUE_LEN=1024 * 200, # max. 200kB length for a *serialized* value.
26 # MAXHOLD_TIME=60 * 60 * 24 * 7 * 4, # 4 weeks
27 )
28 )
29 return _DATA_CACHE