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

27 lines
483 B
Python
Raw Normal View History

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