mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-05 00:09:18 +00:00
return files clearded from clear_dl_cache
This commit is contained in:
@@ -122,10 +122,13 @@ def clear_dl_cache(config):
|
|||||||
"""clear leftover files from dl cache"""
|
"""clear leftover files from dl cache"""
|
||||||
print("clear download cache")
|
print("clear download cache")
|
||||||
cache_dir = os.path.join(config["application"]["cache_dir"], "download")
|
cache_dir = os.path.join(config["application"]["cache_dir"], "download")
|
||||||
for cached in os.listdir(cache_dir):
|
leftover_files = os.listdir(cache_dir)
|
||||||
|
for cached in leftover_files:
|
||||||
to_delete = os.path.join(cache_dir, cached)
|
to_delete = os.path.join(cache_dir, cached)
|
||||||
os.remove(to_delete)
|
os.remove(to_delete)
|
||||||
|
|
||||||
|
return len(leftover_files)
|
||||||
|
|
||||||
|
|
||||||
def get_mapping():
|
def get_mapping():
|
||||||
"""read index_mapping.json and get expected mapping and settings"""
|
"""read index_mapping.json and get expected mapping and settings"""
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ def kill_dl(task_id):
|
|||||||
_ = RedisArchivist().del_message("dl_queue_id")
|
_ = RedisArchivist().del_message("dl_queue_id")
|
||||||
RedisQueue(queue_name="dl_queue").clear()
|
RedisQueue(queue_name="dl_queue").clear()
|
||||||
|
|
||||||
clear_dl_cache(CONFIG)
|
_ = clear_dl_cache(CONFIG)
|
||||||
|
|
||||||
# notify
|
# notify
|
||||||
mess_dict = {
|
mess_dict = {
|
||||||
|
|||||||
Reference in New Issue
Block a user