music-kraken-core/music_kraken/cli/options/cache.py
2024-04-09 10:32:17 +02:00

27 lines
483 B
Python

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")