Skip to content

Commit 62808a8

Browse files
committed
Revert "improve naming"
This reverts commit fe5b4ca.
1 parent fe5b4ca commit 62808a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/service-library/src/servicelib/async_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ class TaskCancelled(Exception):
223223
async def _poller_for_task_group(
224224
close_event: asyncio.Event,
225225
cancel_awaitable: TaskCancelCallback,
226-
poll_interval_s: float,
226+
poll_interval: float,
227227
):
228228
"""
229229
Polls for cancellation via the callback and raises TaskCancelled if it occurs.
230230
"""
231231
while not await cancel_awaitable():
232-
await asyncio.sleep(poll_interval_s)
232+
await asyncio.sleep(poll_interval)
233233
if close_event.is_set():
234234
return
235235
raise TaskCancelled
@@ -239,7 +239,7 @@ async def run_until_cancelled(
239239
*,
240240
coro: Coroutine,
241241
cancel_callback: TaskCancelCallback,
242-
poll_interval_s: float = _POLL_INTERVAL_S,
242+
poll_interval: float = _POLL_INTERVAL_S,
243243
) -> Any:
244244
"""
245245
Runs the given coroutine until it completes or cancellation is requested.
@@ -258,7 +258,7 @@ async def run_until_cancelled(
258258
# One to poll for cancellation
259259
tg.create_task(
260260
_poller_for_task_group(
261-
close_poller_event, cancel_callback, poll_interval_s
261+
close_poller_event, cancel_callback, poll_interval
262262
),
263263
name=f"run_until_cancelled/poller/{coro.__name__}/{id(sentinel)}",
264264
)

packages/service-library/src/servicelib/fastapi/cancellation_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
6363
cancel_callback=partial(
6464
_is_client_disconnected, receive, queue, request
6565
),
66-
poll_interval_s=0.0,
66+
poll_interval=0.0,
6767
)
6868
return
6969

0 commit comments

Comments
 (0)