mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 09:19:48 +00:00
[tasks] Only update the time interval if the body has run once
Fix #8151
This commit is contained in:
parent
1ba290d8c6
commit
903e2e64e9
@ -754,7 +754,8 @@ class Loop(Generic[LF]):
|
|||||||
self._time = self._get_time_parameter(time)
|
self._time = self._get_time_parameter(time)
|
||||||
self._sleep = self._seconds = self._minutes = self._hours = MISSING
|
self._sleep = self._seconds = self._minutes = self._hours = MISSING
|
||||||
|
|
||||||
if self.is_running():
|
# Only update the interval if we've ran the body at least once
|
||||||
|
if self.is_running() and self._last_iteration is not MISSING:
|
||||||
self._next_iteration = self._get_next_sleep_time()
|
self._next_iteration = self._get_next_sleep_time()
|
||||||
if self._handle and not self._handle.done():
|
if self._handle and not self._handle.done():
|
||||||
# the loop is sleeping, recalculate based on new interval
|
# the loop is sleeping, recalculate based on new interval
|
||||||
|
Loading…
x
Reference in New Issue
Block a user