[tasks] Only correct for clock drift if an explicit time is given

This commit is contained in:
Rapptz 2022-03-13 22:51:10 -04:00
parent f2586e9fe7
commit 603681940f

View File

@ -223,7 +223,7 @@ class Loop(Generic[LF]):
# the next iteration always follows the last iteration.
# Sometimes asyncio is cheeky and wakes up a few microseconds before our target
# time, causing it to repeat a run.
while self._next_iteration <= self._last_iteration:
while self._is_explicit_time() and self._next_iteration <= self._last_iteration:
_log.warn(
(
'Clock drift detected for task %s. Woke up at %s but needed to sleep until %s. '