Skip to content

Commit 1f430f7

Browse files
committed
@sanderegg review: fun is not coro
1 parent 631e7f3 commit 1f430f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def periodic(
5858
"""
5959

6060
def _decorator(
61-
coro: Callable[P, Coroutine[Any, Any, None]],
61+
async_fun: Callable[P, Coroutine[Any, Any, None]],
6262
) -> Callable[P, Coroutine[Any, Any, None]]:
6363
class _InternalTryAgain(TryAgain):
6464
# Local exception to prevent reacting to similarTryAgain exceptions raised by the wrapped func
@@ -82,10 +82,10 @@ class _InternalTryAgain(TryAgain):
8282
),
8383
before_sleep=before_sleep_log(_logger, logging.DEBUG),
8484
)
85-
@functools.wraps(coro)
85+
@functools.wraps(async_fun)
8686
async def _wrapper(*args: P.args, **kwargs: P.kwargs) -> None:
8787
with log_catch(_logger, reraise=True):
88-
await coro(*args, **kwargs)
88+
await async_fun(*args, **kwargs)
8989
raise _InternalTryAgain
9090

9191
return _wrapper

0 commit comments

Comments
 (0)