mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
return files clearded from clear_dl_cache
This commit is contained in:
parent
d73a131616
commit
83057d9e54
@ -122,10 +122,13 @@ def clear_dl_cache(config):
|
||||
"""clear leftover files from dl cache"""
|
||||
print("clear download cache")
|
||||
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)
|
||||
os.remove(to_delete)
|
||||
|
||||
return len(leftover_files)
|
||||
|
||||
|
||||
def get_mapping():
|
||||
"""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")
|
||||
RedisQueue(queue_name="dl_queue").clear()
|
||||
|
||||
clear_dl_cache(CONFIG)
|
||||
_ = clear_dl_cache(CONFIG)
|
||||
|
||||
# notify
|
||||
mess_dict = {
|
||||
|
Loading…
Reference in New Issue
Block a user