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__(
125
125
self ._is_being_cancelled = False
126
126
self ._has_failed = False
127
127
self ._stop_next_iteration = False
128
- self ._tasks : list [asyncio .Task [Any ]] = []
128
+ self ._tasks : set [asyncio .Task [Any ]] = set ()
129
129
130
130
if self .count is not None and self .count <= 0 :
131
131
raise ValueError ("count must be greater than 0 or None." )
@@ -200,8 +200,8 @@ async def run_with_semaphore():
200
200
),
201
201
name = f"pycord-loop-{ self .coro .__name__ } -{ self ._current_loop } " ,
202
202
)
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 )
205
205
206
206
_current_loop_ctx .reset (token )
207
207
self ._last_iteration_failed = False
You can’t perform that action at this time.
0 commit comments