MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / safe_corrupted_get

Function safe_corrupted_get

botasaurus/cache.py:82–89  ·  view source on GitHub ↗
(cache_path)

Source from the content-addressed store, hash-verified

80 return results
81
82def safe_corrupted_get(cache_path):
83 try:
84 read_json(cache_path)
85 return 0
86 except (JSONDecodeError, FileNotFoundError):
87 _remove(cache_path)
88 # These are files which are corrupted, likely as user paused when files were being written.
89 return 1
90
91def _delete_corrupted_cached_items(file_paths):
92 from joblib import Parallel, delayed

Callers

nothing calls this directly

Calls 2

read_jsonFunction · 0.70
_removeFunction · 0.70

Tested by

no test coverage detected