music-kraken-core/music_kraken/development_cli/options/cache.py

27 lines
483 B
Python
Raw Normal View History

2024-06-19 09:02:58 +00:00
from logging import getLogger
from ..utils import cli_function
from ...connection.cache import Cache
@cli_function
def clear_cache():
"""
Deletes the cache.
:return:
"""
Cache("main", getLogger("cache")).clear()
print("Cleared cache")
@cli_function
def clean_cache():
"""
Deletes the outdated cache. (all expired cached files, and not indexed files)
:return:
"""
Cache("main", getLogger("cache")).clean()
print("Cleaned cache")