mirror of
https://github.com/searxng/searxng.git
synced 2025-12-24 04:30:02 +00:00
[mod] ExpireCacheSQLite - implement .setmany() for bulk loading
[1] https://github.com/searxng/searxng/issues/5223#issuecomment-3328597147 Suggested-by: Ivan G <igabaldon@inetol.net> [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Markus Heiser
parent
4f4de3fc87
commit
18a58943cc
20
searx/data/__main__.py
Normal file
20
searx/data/__main__.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Command line implementation"""
|
||||
|
||||
import typer
|
||||
|
||||
from .core import get_cache
|
||||
|
||||
app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def state():
|
||||
"""show state of the cache"""
|
||||
cache = get_cache()
|
||||
for table in cache.table_names:
|
||||
for row in cache.DB.execute(f"SELECT count(*) FROM {table}"):
|
||||
print(f"cache table {table} holds {row[0]} key/value pairs")
|
||||
|
||||
|
||||
app()
|
||||
Reference in New Issue
Block a user