async def _get_cached_entity(self, entity: FileEntity, is_ctti: bool) -> Optional[FileEntity]:
        """Get cached entity if it exists in storage."""
        # Check if file exists in storage (but not fully processed)
        # Note: CTTI files are handled differently by web_fetcher,
        # so this mainly applies to non-CTTI files
        if not is_ctti and entity.sync_id:
            cached_path = await storage_manager.get_cached_file_path(
                entity.sync_id, entity.entity_id, entity.name
            )

            if cached_path:
                logger.info(
                    f"File found in storage cache, using cached version "
                    f"(entity_id: {entity.entity_id}, sync_id: {entity.sync_id}, "
                    f"cached_path: {cached_path})"
                )

                # Update entity with cached file info
                entity.local_path = cached_path
                entity.storage_blob_name = storage_manager._get_blob_name(
                    entity.sync_id, entity.entity_id
                )

                # Calculate checksum from cached file
                with open(cached_path, "rb") as f:
                    content = f.read()
                    entity.checksum = hashlib.sha256(content).hexdigest()
                    entity.total_size = len(content)

                return entity
        return None
Get cached entity if it exists in storage.
backend/airweave/platform/file_handling/file_manager.py