.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
3
from
__future__
import
annotations
4
5
import
pathlib
6
7
from
searx
import
logger
8
from
searx.cache
import
ExpireCacheCfg, ExpireCacheSQLite
9
10
log = logger.getChild(
"data"
)
11
12
data_dir = pathlib.Path(__file__).parent
13
14
_DATA_CACHE: ExpireCacheSQLite =
None
# type: ignore
15
16
17
def
get_cache
():
18
19
global
_DATA_CACHE
# pylint: disable=global-statement
20
21
if
_DATA_CACHE
is
None
:
22
_DATA_CACHE = ExpireCacheSQLite.build_cache(
23
ExpireCacheCfg
(
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
searx.cache.ExpireCacheCfg
Definition
cache.py:34
searx.cache
Definition
cache.py:1
searx.data.core.get_cache
get_cache()
Definition
core.py:17
searxng
searx
data
core.py
Generated on Sun Jun 1 2025 21:11:46 for .oO SearXNG Developer Documentation Oo. by
1.13.2