2024-01-22 08:36:14 +00:00
|
|
|
from logging import getLogger
|
|
|
|
|
2024-01-29 07:39:57 +00:00
|
|
|
from ..utils import cli_function
|
2024-01-22 08:36:14 +00:00
|
|
|
from ...connection.cache import Cache
|
|
|
|
|
|
|
|
|
2024-01-29 07:39:57 +00:00
|
|
|
@cli_function
|
2024-01-22 08:36:14 +00:00
|
|
|
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-22 08:36:14 +00:00
|
|
|
|
|
|
|
|
2024-01-29 07:39:57 +00:00
|
|
|
@cli_function
|
2024-01-22 08:36:14 +00:00
|
|
|
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")
|