Skip to content

Commit

Permalink
Update src/crawlee/memory_storage_client/_key_value_store_client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vdusek authored Oct 22, 2024
1 parent e28fb28 commit ec87446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/crawlee/memory_storage_client/_key_value_store_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,17 @@ async def get_public_url(self, key: str) -> str:
id=self.id,
name=self.name,
)

if existing_store_by_id is None:
raise_on_non_existing_storage(StorageTypes.KEY_VALUE_STORE, self.id)

resource_dir = existing_store_by_id.resource_directory

record = await self._get_record_internal(key)
record_filename = record.filename if record else key

if record_filename is None:
if not record:
raise ValueError(f'Record with key "{key}" was not found.')

resource_dir = existing_store_by_id.resource_directory
record_filename = self._filename_from_record(record)
record_path = os.path.join(resource_dir, record_filename)
return f'file://{record_path}'

Expand Down

0 comments on commit ec87446

Please sign in to comment.