mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
[tasks] Fix initial loop execution running prematurely
This commit is contained in:
parent
d24a339dbf
commit
19ad64adda
@ -584,12 +584,13 @@ class Loop(Generic[LF]):
|
|||||||
time_now = (
|
time_now = (
|
||||||
now if now is not MISSING else datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
|
now if now is not MISSING else datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
|
||||||
).timetz()
|
).timetz()
|
||||||
|
idx = -1
|
||||||
for idx, time in enumerate(self._time):
|
for idx, time in enumerate(self._time):
|
||||||
if time >= time_now:
|
if time >= time_now:
|
||||||
self._time_index = idx
|
self._time_index = idx
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self._time_index = 0
|
self._time_index = idx + 1
|
||||||
|
|
||||||
def _get_time_parameter(
|
def _get_time_parameter(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user