mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
[tasks] Replace None check with MISSING check in task loop
This commit is contained in:
parent
ef6f5d947a
commit
42a538edda
@ -185,7 +185,7 @@ class Loop(Generic[LF]):
|
|||||||
now = datetime.datetime.now(datetime.timezone.utc)
|
now = datetime.datetime.now(datetime.timezone.utc)
|
||||||
if now > self._next_iteration:
|
if now > self._next_iteration:
|
||||||
self._next_iteration = now
|
self._next_iteration = now
|
||||||
if self._time is not None:
|
if self._time is not MISSING:
|
||||||
self._prepare_time_index(now)
|
self._prepare_time_index(now)
|
||||||
|
|
||||||
self._current_loop += 1
|
self._current_loop += 1
|
||||||
@ -673,7 +673,7 @@ class Loop(Generic[LF]):
|
|||||||
self._sleep = self._seconds = self._minutes = self._hours = MISSING
|
self._sleep = self._seconds = self._minutes = self._hours = MISSING
|
||||||
|
|
||||||
if self.is_running():
|
if self.is_running():
|
||||||
if self._time is not None:
|
if self._time is not MISSING:
|
||||||
# prepare the next time index starting from after the last iteration
|
# prepare the next time index starting from after the last iteration
|
||||||
self._prepare_time_index(now=self._last_iteration)
|
self._prepare_time_index(now=self._last_iteration)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user