File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ def __init__(
125125 self ._is_being_cancelled = False
126126 self ._has_failed = False
127127 self ._stop_next_iteration = False
128- self ._tasks : list [asyncio .Task [Any ]] = []
128+ self ._tasks : set [asyncio .Task [Any ]] = set ()
129129
130130 if self .count is not None and self .count <= 0 :
131131 raise ValueError ("count must be greater than 0 or None." )
@@ -200,8 +200,8 @@ async def run_with_semaphore():
200200 ),
201201 name = f"pycord-loop-{ self .coro .__name__ } -{ self ._current_loop } " ,
202202 )
203- task .add_done_callback (self ._tasks .remove )
204- self ._tasks .append (task )
203+ task .add_done_callback (lambda t : self ._tasks .discard ( t ) )
204+ self ._tasks .add (task )
205205
206206 _current_loop_ctx .reset (token )
207207 self ._last_iteration_failed = False
You can’t perform that action at this time.
0 commit comments