From f5727ff0d011f6706b978b1e922d2ceab92885d4 Mon Sep 17 00:00:00 2001 From: Sebastian Law Date: Mon, 10 May 2021 17:25:16 -0700 Subject: [PATCH] [tasks] fix regular task loops --- discord/ext/tasks/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py index 81e8dc79d..940b9f889 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: