Skip to content

Commit 44f2848

Browse files
committed
mypy
1 parent f767833 commit 44f2848

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ async def _periodic_scheduled_task(
4646
**task_kwargs,
4747
) -> None:
4848
# NOTE: This retries forever unless cancelled
49-
nap = asyncio.sleep
50-
if early_wake_up_event is not None:
51-
nap = SleepUsingAsyncioEvent(early_wake_up_event)
49+
nap = (
50+
asyncio.sleep
51+
if early_wake_up_event is None
52+
else SleepUsingAsyncioEvent(early_wake_up_event)
53+
)
5254
async for attempt in AsyncRetrying(
5355
sleep=nap,
5456
wait=wait_fixed(interval.total_seconds()),

0 commit comments

Comments
 (0)