mirror of
https://github.com/searxng/searxng.git
synced 2025-10-27 16:52:30 -04:00
[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>
21 lines
418 B
Python
21 lines
418 B
Python
# 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()
|