Skip to content

Commit da63626

Browse files
committed
sched.py Fix bug where coro was scheduled after 1000s.
1 parent d6ae022 commit da63626

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

v3/as_drivers/sched/sched.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ async def schedule(func, *args, times=None, **kwargs):
1414
while times is None or times > 0:
1515
tw = fcron(int(time())) # Time to wait (s)
1616
while tw > 0: # While there is still time to wait
17-
tw = min(tw, maxt)
18-
await asyncio.sleep(tw)
17+
await asyncio.sleep(min(tw, maxt))
1918
tw -= maxt
2019
res = launch(func, args)
2120
if times is not None:

0 commit comments

Comments
 (0)