mirror of
https://github.com/searxng/searxng.git
synced 2026-05-16 16:05:47 +02:00
[fix] engine wikidata - fails to initialize with HTTP 403 (#6081)
In order not to be further blocked, the WIKIDATA_PROPERTIES are cached, which drastically reduces the WD-SQL request. BTW: improve type hints Closes: https://github.com/searxng/searxng/issues/6051 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
+7
-1
@@ -114,7 +114,13 @@ class ExpireCacheStats:
|
||||
if expire:
|
||||
valid_until = datetime.datetime.fromtimestamp(expire).strftime("%Y-%m-%d %H:%M:%S")
|
||||
c_kv += 1
|
||||
lines.append(f"[{ctx_name:20s}] {valid_until} {key:12}" f" --> ({type(value).__name__}) {value} ")
|
||||
value_str = str(value)
|
||||
if len(value_str) > 120:
|
||||
value_str = f"{value_str[:120]} ..."
|
||||
lines.append(
|
||||
f"[{ctx_name:20s}] {valid_until} {key:12}"
|
||||
f" --> ({type(value).__name__}:{len(value)}) {value_str} "
|
||||
)
|
||||
|
||||
lines.append(f"Number of contexts: {c_ctx}")
|
||||
lines.append(f"number of key/value pairs: {c_kv}")
|
||||
|
||||
Reference in New Issue
Block a user