File tree Expand file tree Collapse file tree
src/apify/storage_clients/_apify Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import asyncio
34import re
45from base64 import b64encode
56from hashlib import sha256
1112from apify import Request
1213
1314if TYPE_CHECKING :
14- import asyncio
1515 from collections .abc import Iterable
1616
1717 from apify_client ._models import HeadRequest , LockedHeadRequest
@@ -95,7 +95,9 @@ async def resolve_awaited_in_flight(
9595 so the caller retries them rather than receiving false success.
9696 """
9797 for request , future in awaited_in_flight :
98- if await future :
98+ # Shield the shared in-flight marker: cancelling this awaiting caller must not cancel the future, which
99+ # is owned by the original producer and may have other callers waiting on it.
100+ if await asyncio .shield (future ):
99101 api_response .processed_requests .append (
100102 ProcessedRequest (
101103 id = unique_key_to_request_id (request .unique_key ),
You can’t perform that action at this time.
0 commit comments