Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/apify/storage_clients/_apify/_request_queue_single_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,16 @@ async def _list_head(self) -> None:
else:
# Only fetch the request if we do not know it yet.
if request.unique_key not in self._requests_cache:
request = Request.model_validate(
await self._api_client.get_request(unique_key_to_request_id(request.unique_key))
)
self._requests_cache[request.unique_key] = request
request_id = unique_key_to_request_id(request.unique_key)
complete_request_data = await self._api_client.get_request(request_id)

if complete_request_data is not None:
request = Request.model_validate(complete_request_data)
self._requests_cache[request.unique_key] = request
else:
logger.warning(
f'Could not fetch request data for unique_key=`{request.unique_key}` (id=`{request_id}`)'
)

# Add new requests to the end of the head, unless already present in head
if request.unique_key not in self._head_requests:
Expand Down