Clean up the cloned repository after processing.
(clone_config: CloneConfig)
| 33 | |
| 34 | |
| 35 | def _cleanup_repository(clone_config: CloneConfig) -> None: |
| 36 | """Clean up the cloned repository after processing.""" |
| 37 | try: |
| 38 | local_path = Path(clone_config.local_path) |
| 39 | if local_path.exists(): |
| 40 | shutil.rmtree(local_path) |
| 41 | logger.info("Successfully cleaned up repository", extra={"local_path": str(local_path)}) |
| 42 | except (PermissionError, OSError): |
| 43 | logger.exception("Could not delete repository", extra={"local_path": str(clone_config.local_path)}) |
| 44 | |
| 45 | |
| 46 | async def _check_s3_cache( |