MCPcopy
hub / github.com/omkarcloud/botasaurus / delete_corrupted_items

Method delete_corrupted_items

botasaurus/cache.py:333–344  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

331
332 @staticmethod
333 def delete_corrupted_items(func):
334 hashes = Cache.get_items_hashes(func, None)
335 fn_name = getfnname(func)
336 paths = [relative_path(f'{Cache.cache_directory}{fn_name}/{r}.json') for r in hashes]
337 corrupted_items_removed = sum(_delete_corrupted_cached_items(paths))
338 if corrupted_items_removed:
339 item_plural = pluralize('item', corrupted_items_removed)
340 print(f"Deleted {corrupted_items_removed} corrupted {item_plural}")
341 else:
342 print("No corrupted items found")
343
344 return corrupted_items_removed
345
346 @staticmethod
347 def generate_cache_path_from_hash(func, hash):

Callers

nothing calls this directly

Calls 5

getfnnameFunction · 0.85
get_items_hashesMethod · 0.80
relative_pathFunction · 0.70
pluralizeFunction · 0.70

Tested by

no test coverage detected