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