Skip to content

Commit 7440dd0

Browse files
committed
address feedback
1 parent 53d44ad commit 7440dd0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/apify/storage_clients/_apify/_request_queue_single_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,26 @@ async def _list_head(self) -> None:
246246
if request.unique_key in self._requests_in_progress:
247247
# Ignore requests that are already in progress, we will not process them again.
248248
continue
249+
249250
if request.was_already_handled:
250251
# Do not cache fully handled requests, we do not need them. Just cache their unique_key.
251252
self._requests_already_handled.add(request.unique_key)
252253
else:
253254
# Only fetch the request if we do not know it yet.
254255
if request.unique_key not in self._requests_cache:
255256
request_id = unique_key_to_request_id(request.unique_key)
257+
256258
if request_data is not None and request_id != request_data['id']:
257259
logger.warning(
258260
f'Request ID mismatch: {request_id} != {request_data["id"]}, '
259261
'this may cause unexpected behavior.'
260262
)
263+
264+
# See https://github.com/apify/apify-sdk-python/issues/630 for details.
265+
if '[truncated]' not in request.unique_key:
266+
request_data = await self._api_client.get_request(request_id=request_id) # noqa: PLW2901
267+
request = Request.model_validate(request_data)
268+
261269
self._requests_cache[request.unique_key] = request
262270

263271
# Add new requests to the end of the head, unless already present in head

0 commit comments

Comments
 (0)