(cache_path)
| 80 | return results |
| 81 | |
| 82 | def 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 | |
| 91 | def _delete_corrupted_cached_items(file_paths): |
| 92 | from joblib import Parallel, delayed |