aboutsummaryrefslogtreecommitdiff
path: root/discord/ext
diff options
context:
space:
mode:
authorSebastian Law <[email protected]>2021-05-10 17:25:16 -0700
committerGitHub <[email protected]>2021-05-10 20:25:16 -0400
commitf5727ff0d011f6706b978b1e922d2ceab92885d4 (patch)
treeb66e5504c5883c06fb7e83ae7d50ecf14e3347a1 /discord/ext
parentType up **kwargs of various methods (diff)
downloaddiscord.py-f5727ff0d011f6706b978b1e922d2ceab92885d4.tar.xz
discord.py-f5727ff0d011f6706b978b1e922d2ceab92885d4.zip
[tasks] fix regular task loops
Diffstat (limited to 'discord/ext')
-rw-r--r--discord/ext/tasks/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py
index 81e8dc79..940b9f88 100644
--- a/discord/ext/tasks/__init__.py
+++ b/discord/ext/tasks/__init__.py
@@ -151,8 +151,9 @@ class Loop:
now = datetime.datetime.now(datetime.timezone.utc)
if now > self._next_iteration:
- self._prepare_time_index(now)
self._next_iteration = now
+ if self._time is not None:
+ self._prepare_time_index(now)
self._current_loop += 1
if self._current_loop == self.count: